You are not logged in.
Pages: 1
This is not working.
echo xx | sudo -S chown andy:andy -R %F
I want it change ownership of files from root to myself.
It works in a script.
Ubuntu-Mate 24.04
Offline
This is the one we supply with the distro, and that works. :
gnome-keyring-daemon -r -d;gksu "chown -R $USER:$USER %F"
A bit more complicated to solve the keyring annoyance and to generalize for any user.
MX-23 (based on Debian Stable) with our flagship Xfce 4.18.
Offline
Thanks so much. :-)
Ubuntu-Mate 24.04
Offline
are you expecting the echoed value to be used?
Offline
are you expecting the echoed value to be used?
It's not my real password.
But the echo has worked with other custom actions.
Ubuntu-Mate 24.04
Offline
you should not have to repeatedly enter your password. properly configured, it should cache your authentication so that you enter your password just once and subsequent runs of sudo should not want your password.
Offline
But the echo has worked with other custom actions.
Try embedding it inside a bash block:
bash -c "echo 'xx' | sudo -S chown andy:andy -R %F"
...this creates a bash environment to run the command in. The default environment when running custom actions is not your regular bash environment.
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
Jerry3904 gnome-keyring-daemon -r -d;gksu "chown -R $USER:$USER %F" worked great.
I forgot how to make a code section.
Last edited by fixit (2019-03-01 20:06:57)
Ubuntu-Mate 24.04
Offline
Pages: 1
[ Generated in 0.016 seconds, 12 queries executed - Memory usage: 537.35 KiB (Peak: 538.2 KiB) ]