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

javascript - IndexedDB error: Uncaught DataCloneError: Failed to execute 'put' on 'IDBObjectStore': An object could not be cloned -

amazon web services - When using Cognito credentials with AWS in a browser (javascript), keep getting "missing credentials" error -

c# - How to set the datatextfield value instead of the value on a drop down list? -