Re: Why doesn't this sudo script using zenity work??
- From: William Case <billlinux@xxxxxxxxxx>
- Date: Sat, 02 Dec 2006 19:38:02 -0500
Thanks Stefano;
It now works.
On Sat, 2006-12-02 at 20:16 +0100, Stefano Sabatini wrote:
Hi William.
On Friday 2006-12-01 11:15:33 -0500, William Case wrote:
Tried:
Nothing shows up on my desktop.
How did you try it?
Wrote it as a script in a file called RootBrowser. Changed the
permissions to executable by bill (as usual). I have bill's PATH
including $HOME/.gnome2/nautilus-scripts. Tried .RootBrowser from the
command line. It worked but gave me the last two lines as returns for
the gterm.
Tried it as a single command line. It worked as above.
If you wrote it in a file and then launched itI did that.
get sure to put in the first line
#! /usr/bin/bash
and to change permission of the file (it has to be executable at leastI did that.
by you).
I'm trying this script and it works both as a script launched fromDidn't use sudo -k but it makes sense as a precaution
gnome-terminal and when it's called by a gnome-panel launcher:
#! /bin/bash
# this forces the password typing, even in the case the sudo timeout has
# not yet expired
sudo -k
Knew I probably wanted to background or /dev/null return variabless 1 &
zenity --entry --title="Browse files as root" --text="Enter your password:" --hide-text \
| sudo -S nautilus --no-desktop --browser 1> /dev/null 2> /dev/null
2 above but wasn't sure how to go about it. Had read some manuals about
file descriptors but have never need to use them, so didn't know how to
use 1 & 2 to send the lines /dev/null. Tried things that were far too
complex that obviously didn't work. So, thanks that was the solution I
needed.
if [ "$?" != 0 ]; thenEssentially did that. Knew to do it but hadn't written it yet trying to
zenity --error --text="Sorry, bad password"
return 1
fi
keep the number of possible complications down until the rest worked.
Thanks for the explanation. I'll go back and 'man' for your kind ofWhat do I do with these two lines?
Anything you want to do with them ;-). If you don't like this output
you can simply send it to /dev/null (as in the above script). sudo
prints the "password:" prompt on stderr (file descriptor number 2),
nautilus writes on both stderr and stdin (file descriptor number
1). If you are running the script through a launcher the output will
be happily ignored.
comments if I have further questions.
HTH--
Ciao!
_______________________________________________
gnome-list mailing list
gnome-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gnome-list
Regards Bill
_______________________________________________
gnome-list mailing list
gnome-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gnome-list
- References:
- Why doesn't this sudo script using zenity work??
- From: William Case
- Re: Why doesn't this sudo script using zenity work??
- From: Stefano Sabatini
- Re: Why doesn't this sudo script using zenity work??
- From: William Case
- Re: Why doesn't this sudo script using zenity work??
- From: Stefano Sabatini
- Why doesn't this sudo script using zenity work??
- Prev by Date: Re: Folders like Desktop
- Next by Date: Re: Folders like Desktop
- Previous by thread: Re: Why doesn't this sudo script using zenity work??
- Next by thread: Re: Why doesn't this sudo script using zenity work??
- Index(es):
Relevant Pages
|
|