The problem: Edit many files in one single kate process.
FILE_LIST is a variable which contains a list of path
FILE_LIST="$MAIN_PATH1 $MAIN_PATH2 ... $MAIN_PATH3"
DST_DIR is the destination folder in
/tmp
for the symlink of the files to edit.A for - loop feed a find request
The find request uses xargs to build the link files; one uses
print0/-0
because some filename contains spacefor A_DIR in $LIST_PATH ; do find "$A_DIR" -type f ! -name "*.*~" ! -path "*000_ERRORS*" ! -path "*KEEP*" -print0 | xargs -0 -I@ bash -c " ln -s \"@\" \"$DST_DIR/${@##*/}\"" done
Up to here everything is alright. All symlinks are in one folder.
Then another finds request feed kate at once.
find "$WORK_PATH" -type l -print0 | xargs -0 -I{} xdg-su -c "kate {} "
That does not work as expected. Files are only accessible one by one. That is not the goal.
But in another terminal if I run manually second find request command :
find /tmp/000_PGM_001 -type l -print0 | xargs -L 1 -0 -I{} bash -c "kate '{}'"
I may obtain all the files in the same instance. I may manually repeat the command until I get all the files in one kate install.