1 2 3 4 5 6 7 8 9 10 11 12
#!/usr/bin/env bash set -eu echo "arg[#]: $#" echo "arg[0]: $0" i=0 for arg in "$@"; do i=$((i+1)) echo "arg[$i]: ${arg}" done