Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2014
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. Step1: $vi /home/user1/scripts/my_script.sh
  2.  
  3. #!/bin/bash
  4. # My first script
  5.  
  6. echo "Hello World!"
  7.  
  8. **Setting permissions**
  9. Step2: $chmod 755 my_script (The "755" will give you read, write, and execute permission.
  10. Everybody else will get only read and execute permission. If you want your script to be private (i.e., only you can read and execute), use "700" instead.)
  11.  
  12. **Putting it in your path**
  13. Step3:
  14. $ echo $PATH
  15. $ export PATH=$PATH:/home/user1/scripts
  16.  
  17. **Executing the Command**
  18. $my_script
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement