Tuesday, August 30, 2016

Linux Bash Shell Script Command Line Arguments List and Count


How the code below works:

The code lists and count all the command line arguments passed into the program.

Code To Count Arguments:

Save the code in a file named "CmdArgumentsLister.sh".

Running the Code:

Just type the code below in terminal. Make sure to cd into that directory if you have not opened the terminal in that directory.

bash CmdArgumentsLister.sh a b c d

No comments: