thioshp

Bash Create a New Script

Sep 8th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.31 KB | None | 0 0
  1. #!/data/data/com.termux/files/usr/bin/bash
  2.  
  3. # Create a new executable script in ~/bin, edit it in vim then make it executable
  4.  
  5. NEWSCRIPT="$1"
  6.  
  7. # Add bash header
  8. echo -e "#!$PREFIX/bin/bash\n" > $HOME/bin/$NEWSCRIPT
  9.  
  10. # Edit script using vim
  11. vim $HOME/bin/$NEWSCRIPT
  12.  
  13. # Make script executable
  14. chmod 775 $HOME/bin/$NEWSCRIPT
Add Comment
Please, Sign In to add comment