Re: Why doesn't this sudo script using zenity work??
- From: Stefano Sabatini <stefano.sabatini-lala@xxxxxxxx>
- Date: Sat, 2 Dec 2006 20:16:06 +0100
Hi William.
On Friday 2006-12-01 11:15:33 -0500, William Case wrote:
Tried:
zenity --entry \
--title="Browse files as root" \
--text="Enter your _password:" \
--entry-text "" \
--hide-text | sudo -S nautilus --no-desktop --browser
Nothing shows up on my desktop.
How did you try it? If you wrote it in a file and then launched it
get sure to put in the first line
#! /usr/bin/bash
and to change permission of the file (it has to be executable at least
by you).
I'm trying this script and it works both as a script launched from
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
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
if [ "$?" != 0 ]; then
zenity --error --text="Sorry, bad password"
return 1
fi
Tried it again in gTerminal and got:
my file browser in root plus:
Password:
[Entered through zenity ==> File Browser plus in stdout / stderror?]
Initializing nautilus-search-tool extension
Initializing nautilus-open-terminal extension
What 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.
HTH
Ciao!
_______________________________________________
gnome-list mailing list
gnome-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gnome-list
- Follow-Ups:
- 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??
- 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
- Why doesn't this sudo script using zenity work??
- Prev by Date: 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
|
|