Skip to content

un-ro/linux-script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My Collection of shell script

Current Distro:
My screenfetch

Know your shell

Determine your shell first:

  • In Terminal echo $0

To change your shell:

  1. In Terminal cat /etc/shells
  2. In the first line of script add # !shell-path

Run Script

  1. Write Script
  2. Set Permission, in Terminal chmod permission_code script_file
  3. Run script in Terminal ./script_file
  4. Done

(Optional) Setting up PATH:

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!

  1. In Terminal export PATH=$PATH:*script_directory*. It must be full, example: export PATH=$PATH:~/User/folder/.../folder/main_script
  2. Check if it registered, in Terminal echo $PATH
  3. If not registered check again no.1
  4. Now you can just have to type hello_world. In this case, repo have hello_world script inside.

Reference

Learn Shell
Unix Permissions Calculator

Releases

No releases published

Packages

No packages published

Languages