Advertisement
sanpai

Shell script utility to delete files in system

Oct 6th, 2012
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. dialog --yesno "Do You wish to delete the files in your system" 7 60 \
  4.  
  5. sel=$?
  6.  
  7. case $sel in
  8.  
  9. 0) ls;dialog --inputbox "Enter the file to delete" 7 60 2>input.txt;na=`cat input.txt`;rm $na ;dialog --msgbox "The file has been deleted successfully " 7 60 ;;
  10.  
  11. 1) dialog --msgbox "You have not entered the option " 7 60 ;;
  12.  
  13. 255) dialog --msgbox "You have pressed the ESC key " 7 60 ;;
  14.  
  15. esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement