I have a script that I want to accept any number of command line arguments.
So far I have
if [ -O $1 ] ; then echo "you are the owner of $1" else echo "you are not the owner of $1" fi
Obviously if I wanted the script to only accept one argument this would work but what would work for ANY number of arguments.
ex. ./script f f1 f2 f3
Best Answer
One possible way to do what you want involves
$@
, which is an array of all the arguments passed in.