[SOLVED] What does $1 mean in shell scripts?

would someone please explain what does while ["$1"] mean in the code below? I see it many times in many scripts. What does it refer to?
I also wonder what if [ "$1" = "-i" ] means...
I also wonder what if [ "$1" = "-i" ] means...
- Code: Select all
#!/bin/bash
while [ "$1" ]
do
if [ "$1" = "-i" ] then
infile="$2"
shift 2
elif [ "$1" = "-o" ]
then
outfile="$2"
shift 2
else
echo "Program $0 does not recognize option $1"
fi
done
tr a-z A-Z <$infile >$outfile