Useful stuff

I will continually update this article for something that I think will be useful.

In this article, I will use the color for Ayanami Rei (綾波レイ) and Unit 00 (0号機) 

Shell Programing

Shell variable (cited from here)

$#    Stores the number of command-line arguments that 
      were passed to the shell program.
$?    Stores the exit value of the last command that was 
      executed.
$0    Stores the first word of the entered command (the 
      name of the shell program).
$*    Stores all the arguments that were entered on the
      command line ($1 $2 ...).
"$@"  Stores all the arguments that were entered
      on the command line, individually quoted ("$1" "$2" ...) 

Example:

./command -yes -no /home/username

$# = 3

$*​ = -yes -no /home/username

$@ = array: {“-yes”, “-no”, “/home/username”}

$0 = ./command, $1 = -yes 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s