Created
November 16, 2015 14:39
-
-
Save wujiayi101/bb9b7f377cf2377dfc0a to your computer and use it in GitHub Desktop.
Shell Script Examples
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 | |
# positional.sh | |
# This script reads 3 positional parameters and prints them out. | |
POSPAR1="$1" | |
POSPAR2="$2" | |
POSPAR3="$3" | |
echo "$1 is the first positional parameter, \$1." | |
echo "$2 is the second positional parameter, \$2." | |
echo "$3 is the third positional parameter, \$3." | |
echo | |
echo "The total number of positional parameters is $#." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
reads values from command parameters