This is a discussion on Shell script to delete a file with a dialog utility within the Shell scripting forums, part of the Development/Scripting category; Hello, I am learning shell script by following online documentation of vivek (freeos.com). I need some help to fix the ...
|
|||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
|||
|
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 |
| Sponsored Links | ||
|
|
|
|||
|
Quote:
|
|
|||
|
Quote:
Hi, could you please tell me how you got the dialog utility .I am running ubuntu , not redhat. thanks |
![]() |
| Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Shell Delete Directory | chimu | Slackware | 2 | 05-31-2008 03:36 PM |
| Shell Script to Automatically Delete a File via Cron Job | kakarla | Shell scripting | 2 | 01-29-2008 08:54 AM |
| shell script for ftp the file | vishal_titre | Shell scripting | 3 | 12-10-2007 08:40 AM |
| need help to add user password using dialog utility | vishal Titre | Shell scripting | 3 | 07-13-2006 05:20 PM |
| error shell script no such file or directory /bin/sh | Linux software | 1 | 01-08-2006 08:34 PM | |