Advertisement
Arnab_Manna

Ied shell programing

Nov 28th, 2020
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.89 KB | None | 0 0
  1. echo "_______________________________________________________"
  2. echo "<<<<<<<<<<<<<<<<<< Starting IED >>>>>>>>>>>>>>>>>>>>>>>"
  3. echo "_______________________________________________________"
  4.  
  5. echo -ne "enter a file name >>"
  6. read f1
  7. touch $f1
  8. chmod +x $f1
  9. echo ""
  10. echo "_______________________________________________________"
  11. echo "<<<<<<<<< which editor do you want to use >>>>>>>>>>>>>"
  12. echo "_______________________________________________________"
  13. echo ""
  14. echo "         1> vim      2> nano        3> gedit"
  15.  
  16. echo -ne " enter your choice >>"
  17. read ch
  18. if [ $ch -eq 1 ]
  19. then
  20.         vi $f1
  21. elif [ $ch -eq 2 ]
  22. then
  23.         nano $fi
  24. else
  25. gedit $f1
  26. fi
  27. #vi $f1
  28. echo -ne "do you want to execute the file (y/n) :"
  29. read en1
  30. echo "________________OUTPUT_____________________"
  31. case "$en1" in
  32.         #case 1
  33.         "y")  ./$f1 ;;
  34.  
  35.         #case 2
  36.         "n") echo "process ends" ;;
  37. esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement