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
Post a Comment