Bash script no longer works in F7 ??

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi;

This script used to work in FC6.

#! /bin/bash
# Open Emacs as root at / directory
# file name: RootEmacs

sudo -K
zenity --entry \
	--title="Write root files" \
    --text="Enter your user _password:" \
    --entry-text "" \
    --hide-text |sudo -S emacs / 
    1> /dev/null 2> /dev/null    # Catch stdout & error messages

# zenity --info --text="$?"  # debug attempt
    
if  [ "$?" != 0 ]; then 
	zenity --error --text="Sorry, wrong password"
	exit 1
fi	    
# End

It still works if I open a terminal to run it from the command line.
However, when run from its launcher, it gives me the 'zenity --error
--text="Sorry, wrong password"' for every sudo password i.e. "$?" != 0
never evaluates as not true.  

I have tried to debug. 'echo $?' returns 0 with the correct password
when run from command line. zenity --info --text="$?" returns 0 but
stops instead of continuing to the 'if' line.  The run command in gedit
=> tools errors to "sudo: sorry, you must have a tty to run sudo".

I am completely flummoxed.  I know it is something stupid but I can't
find it.  All help appreciated.

-- 
Regards Bill


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux