Re: Why doesn't this sudo script using zenity work??



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



Relevant Pages

  • Re: PATH ~/bin under gnome
    ... but is executed if present when you log in to GNOME. ... you want to run a script that has a graphical front end (using ... If, on the other hand, you want to use a GNOME menu item or panel launcher ... would have the command field as /home/peter/timer) By placing the same ...
    (Ubuntu)
  • Re: PATH ~/bin under gnome
    ... not on the gnome environment. ... Right - ~/.bashrc works when you call stuff from the command line. ... you want to run a script that has a graphical front end (using ... If, on the other hand, you want to use a GNOME menu item or panel launcher ...
    (Ubuntu)
  • Re: PATH ~/bin under gnome
    ... not on the gnome environment. ... Right - ~/.bashrc works when you call stuff from the command line. ... you want to run a script that has a graphical front end (using ... If, on the other hand, you want to use a GNOME menu item or panel launcher ...
    (Ubuntu)
  • Re: newbie question: how to run a shell script from launcher
    ... > launcher to run a script. ... runLime.sh need to be run from the installation directory. ... script named "LimeWire", ...
    (comp.os.linux.misc)
  • Re: newbie question: how to run a shell script from launcher
    ... I'm using RH9 with GNOME desktop. ... I'm using GNOME, in GNOME I could create a launcher, in it I have ... to create a launcher to run a script. ... the command entry, just like the way I ran it in the install directory ...
    (comp.os.linux.misc)