Kate : list of file to edit seems to long

Hello.

This piece of code work well up to now.
The script build the list, then pass the list to kate.

THE_LIST="$LIST_1A""$LIST_1B""$LIST_1C""$LIST_3""$LIST_4""$LIST_5""$LIST_6""$LIST_13_1""$LIST_13_2""$LIST_14"

xdg-su -c "kate  $THE_LIST"


The list contains about 50 paths of files to edit for about 4,5 KiB ( 4659 ).

Adding a few more paths, brake the command giving less files in the editor, and one with bad name.

Any suggestion is welcome.

PS : passing the list directly to kate ( I can’t remember how I did it ) give all the files correctly in the editor without any error.

Split the list into at least two parts – “THE_LIST-01”, “THE_LIST-02”, “THE_LIST-03” …

  • And then, call a Kate instance for each list – 01, 02, 03 …

Kate readily opens anything which is feed to it: “find /etc/ -type f | xargs kate” results in some 1,300 open tabs.

Thank you for your help.
But where to put xdg-su ?

cat "$MY_LIST_A" | xargs xdg-su -c "kate"

Ok found the good syntax :


echo "$THE_LIST1" | xargs -I '{}'  xdg-su -c "kate  {}"
echo "$THE_LIST2" | xargs -I '{}'  xdg-su -c "kate  {}"

But cannot add LIST2 to kate, until the process which start LIST1 did not stop.

Adding “&” prevent kate to load LIST1


echo "$THE_LIST1" | xargs -I '{}'  xdg-su -c "kate  {}" &

Any help is welcome

Hello.
Have found a solution but I appreciate any comments.
I use 5 scripts and three lists of files.
The lists are named : LIST_A,LIST_B,LIST_C,
the scripts are named PROGRAM.sh,SUB_1.sh,SUB_2.sh,SUB_3.sh,SUB_4.sh
SUB_1 is a parent of SUB_2
SUB_3 is a parent of SUB_4
The whole process need two steps.
In the first step use dolphin in super user mode, open any file.
Save everything in a new session (menu sessions/ save session as MY_PROJECT)

In the second step, run script PROGRAM
Script PROGRAM.sh build all the lists then starts SUB_1 AND SUB_3


#!/bin/bash
#
#
# ~/PROGRAM.sh
#
MAKE_LIST
SUB_1.sh
SUB_3.sh

Script SUB_1 start SUB_2 but don’t wait SUB_2 to finish.

##!/bin/bash
#
#
# ~/SUB_1.sh
#
SUB_2.sh  **"**$LIST_A"   **&**

Script SUB_3 start SUB_4 but don’t wait SUB_4 to finish.

##!/bin/bash
#
#
# ~/SUB_3.sh
#
SUB_4.sh **"**$LIST_B"  **"**$LIST_C"  **&**

Script SUB_2 load files in kate

##!/bin/bash
#
#
# ~/SUB_2.sh
#
echo "$THE_LIST_A" | xargs -I '{}'  xdg-su -c "kate -b -s MY_PROJECT"

Script SUB_4 load files in kate

##!/bin/bash
#
#
# ~/SUB_4.sh
#
echo "$THE_LIST_B" | xargs -I '{}'  xdg-su -c "kate -b -s MY_PROJECT"
echo "$THE_LIST_C" | xargs -I '{}'  xdg-su -c "kate -b -s MY_PROJECT"

Any comments are welcome.