Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Step1: $vi /home/user1/scripts/my_script.sh
- #!/bin/bash
- # My first script
- echo "Hello World!"
- **Setting permissions**
- Step2: $chmod 755 my_script (The "755" will give you read, write, and execute permission.
- 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.)
- **Putting it in your path**
- Step3:
- $ echo $PATH
- $ export PATH=$PATH:/home/user1/scripts
- **Executing the Command**
- $my_script
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement