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 - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -