- In Terminal
echo $0
- In Terminal
cat /etc/shells
- In the first line of script add
# !shell-path
- Write Script
- Set Permission, in Terminal
chmod permission_code script_file
- Run script in Terminal
./script_file
- Done
If you was do step above, you might thinking...
Hmm i must running using ./ again
And here I share how to avoid those problem, and in the future you will only
setting permission only and call file name. Straight!
- In Terminal
export PATH=$PATH:*script_directory*
. It must be full, example:export PATH=$PATH:~/User/folder/.../folder/main_script
- Check if it registered, in Terminal
echo $PATH
- If not registered check again no.1
- Now you can just have to type
hello_world
. In this case, repo have hello_world script inside.