Virajsinh

Driven_Menu_OS_Script

Sep 24th, 2017
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. i=1
  2. echo "This is a menu Driven Program to Perform Variation file Operation"
  3.  
  4. echo "1. List All The Files"
  5. echo "2. Create And Read File"
  6. echo "3. Make Directory"
  7. echo "4. Change Directory"
  8. echo "5. Delete Directory"
  9. echo "6. Present Working Directory"
  10. echo "7. Exit"
  11.  
  12. while [ $i -eq 1 ]
  13. do
  14. echo "Enter Your Chose"
  15. read ch
  16.  
  17. case $ch in
  18. 1) echo "List All The Files"
  19. ls
  20. ;;
  21.  
  22. 2) echo "Enter the Create And Read File"
  23. read filename
  24. gedit $filename
  25. cat $filename
  26. ;;
  27.  
  28. 3) echo "Enter the Make Directory"
  29. read dirnm
  30. mkdir $dirnm
  31. ls -l
  32. ;;
  33.  
  34. 4) echo "Enter the Change Directory"
  35. read chdir
  36. cd $chdir
  37. pwd
  38. cd
  39. ;;
  40.  
  41. 5) echo "Delete Directory"
  42. read dirnm
  43. rm -i -r $dirnm
  44. ;;
  45.  
  46. 6) echo "This is Present Working Directory"
  47. pwd
  48. ;;
  49.  
  50. 7) echo "Exit"
  51. exit
  52. ;;
  53.  
  54. *) echo "Enter Proper Choice"
  55. ;;
  56.  
  57. esac
  58.  
  59. echo "Enter Your Choice Of You Want To Continue"
  60. read i
  61. if [ $i -ne 1 ]
  62. then
  63. exit
  64. fi
  65. done
Add Comment
Please, Sign In to add comment