Skip to content

Instantly share code, notes, and snippets.

@shaik2many
Created December 22, 2014 20:16
Show Gist options
  • Save shaik2many/47cb4b16323b926a4be5 to your computer and use it in GitHub Desktop.
Save shaik2many/47cb4b16323b926a4be5 to your computer and use it in GitHub Desktop.
linux setting shell path
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment