I have ./basscript parm1 parm2 parm3
I want to iterate through the parms starting from parm2 till parmN and append them to a variable.
How do I get ${COMPLETE}="parm1,parm2,parmN"?
I have ./basscript parm1 parm2 parm3
I want to iterate through the parms starting from parm2 till parmN and append them to a variable.
How do I get ${COMPLETE}="parm1,parm2,parmN"?
Maybe something like this:
COMPLETE=""
shift
for a in "$@"
do
if [ "$COMPLETE" == "" ]; then COMPLETE="$a"; else COMPLETE="$COMPLETE,$a" ; fi
done
echo $COMPLETE
This makes COMPLETE a comma-separated list of all the parameters, excluding the first.