Skip to content

Instantly share code, notes, and snippets.

@wujiayi101
Created November 16, 2015 14:39
Show Gist options
  • Save wujiayi101/bb9b7f377cf2377dfc0a to your computer and use it in GitHub Desktop.
Save wujiayi101/bb9b7f377cf2377dfc0a to your computer and use it in GitHub Desktop.
Shell Script Examples
#!/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 $#."
@wujiayi101
Copy link
Author

reads values from command parameters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment