Created
April 1, 2016 05:52
-
-
Save quickgrid/c18baba4c390fe16a7cd68f4e57e9c01 to your computer and use it in GitHub Desktop.
Bash code to list all the command line arguments.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
showargs(){ | |
a=1 | |
for i in $* | |
do | |
echo "The $a number arg is $i" | |
a=$(( $a + 1 )) | |
done | |
} | |
echo "Listing all command line arguments." | |
showargs $* | |
echo "Total:$#" | |
echo "Listing End" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment