Skip to content

Instantly share code, notes, and snippets.

@quickgrid
Created April 1, 2016 05:52
Show Gist options
  • Save quickgrid/c18baba4c390fe16a7cd68f4e57e9c01 to your computer and use it in GitHub Desktop.
Save quickgrid/c18baba4c390fe16a7cd68f4e57e9c01 to your computer and use it in GitHub Desktop.
Bash code to list all the command line arguments.
#!/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