Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # usage: ./thisscript.sh --t0 --tf
- # returns:
- # DATES[0]=start
- # but should return:
- # DATES[0]=start
- # DATES[1]=end
- declare -a DATES
- argc="$@"
- x=0
- for arg in $argc
- do
- case $x in
- "--t0" )
- DATES+=('start') ;;
- "--tf" )
- DATES+=('end') ;;
- "--copy" )
- COPY=true ;;
- esac
- x=$arg
- done
- i=0
- for var in "${DATES[@]}"
- do
- echo "DATES[$i]=${var}"
- let "i++"
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement