Quote:
|
Originally Posted by shankar100
Hello,
I am learning shell script by following online documentation of vivek (freeos.com). I need some help to fix the problem. please see the below script.
dialog --title "Input- Delete a file" --backtitle "Welcome to linux dialog utility" --inputbox "Enter the file name to delete" 8 60 2>/home/shankar/name
sel=$?
out=`cat /home/shankar/name`
case $sel in
0) rm $out; echo "file is deleted";;
1) echo "You pressed cancel";;
255) echo "You pressed ESC";;
esac
rm /home/shankar/name
The above script will delete the given file, what if there is no file exists ( if (! -f $out) ). The script should check for the file on the system , if finds delete that otherwise it leave a message "no such file exists". Please help me 
|
Hi,
could you please tell me how you got the dialog utility .I am running ubuntu , not redhat.
thanks