I have a script that build a list of files (full path) to be edited in the same kate process.
Some of the file may need to be edited as root ( configuration file in /etc )
The command use in the script to start kate is :
.............
......
....
echo
echo "xdg-su -c \"cat $OUTPUT_PATH | xargs kate\""
echo
xdg-su -c "cat "$OUTPUT_PATH" | xargs kate"
After asking for root password, nothing happens.
The list is OK.
This is the script I use for many years
The script is started from a desktop file :
[Desktop Entry]
Comment[en_US]=EDIT ALL IN ONE NVIDIA
Comment=EDIT ALL IN ONE NVIDIA
Exec=sh -c "/run/media/$USER/NVIDIA_OPTIMUS/EDIT_ALL_IN_ONE.sh"
GenericName[en_US]=EDIT ALL IN ONE NVIDIA
GenericName=EDIT ALL IN ONE NVIDIA
Icon=preferences-desktop-menu-edit
MimeType=
Name[en_US]=EDIT ALL IN ONE NVIDIA
Name=EDIT ALL IN ONE NVIDIA
Path=
StartupNotify=true
Terminal=true
TerminalOptions=\s--noclose
Type=Application
X-KDE-SubstituteUID=false
X-KDE-Username=
Why are you inventing something that Kate already has with it’s Sessions? I’ve been using that for ages.
Because I don’t want to create a session for all the cases I need.
All case are generated by scripts so there is no need to create a session.
And as I said I use theses kind of scripts for many years and they stop working to day because I am using now 15.6.
@jcdole:
Is the issue possibly the “xargs” command?
If,
cat "$OUTPUT_PATH"
outputs any blanks or newlines then …
Because Unix filenames can contain blanks and newlines, this default behaviour is often problematic; filenames containing blanks and/or newlines are incorrectly processed by xargs. In these situations it is better to use the -0 option, which prevents such problems. When using this option you will need to ensure that the program which produces the input for xargs also uses a null character as a separator. If that program is GNU find for example, the -print0 option does this for you.
Here is the list submitted to XARGS, seems there is nothing wrong :
https://paste.opensuse.org/pastes/f91c6d667854
PS : replacing xdg-su
by kdesu
in the command give the expected result.
Find something on internet.
It seems that ‘-b’ is mandatory to open multiple files in the same kate instance.
So the command should like :
xdg-su -c "cat "$OUTPUT_PATH" | xargs kate -b"
Seems to work ok using either "xdg-su"
or "kdesu"