Command line arguments in shell script -


following shell script iterates on command line arguments , prints values

for var in "$@"     echo $var done 

now if want iterate second command line argument (the first argument being used other purpose), command exclude first argument alone in iteration ?

use shift:

#!/usr/bin/env bash  shift var in "$@";     echo "$var" done 

Comments

Popular posts from this blog

java - Unable to make sub reports with Jasper -

scala - play framework: Modules were resolved with conflicting cross-version suffixes -

Passing Variables from AngelScript to C++ -