I am working in Ubuntu 11.10 writing some bash scripts
I have a tcsh script containing the following code that I am converting to a bash script.
It reads all the arguments passed to the tcsh script (without the script name and fields matching certain patterns):
strLst=`echo $argv[$firstArg-$lastArg] | tr ' ' '\n' \
| grep -ivE -- '(--check)' \
| grep -ivE -- '(--sort)' \
| grep -ivE -- '(--group)' \
| grep -ivE -- '(--shift)' \
| grep -ivE -- '(-v|--vrb-level)' \
| grep -ivE -- '(-q|--quiet)' \
| grep -ivE -- '(-u|--usage)' \
| grep -ivE -- '(-e|--examples)' \
| grep -ivE -- '(-h|--help)' \
| grep -ivE -- '(--shift=[0-9]+)' \
| grep -ivE -- '--((sort|group)=[0-9]+/[0-9]+(/[0-9]+)*)$' | tr '\n' ' '`
My problem is how to get all arguments, an equivalent to
$argv[$firstArg-$lastArg]