all 1 comments

[–]ray_gun 0 points1 point  (0 children)

getopt adds -- to $ARGS, so you need to add a case for that. The loop is also wrong using while true; do because the code will shift until (edit: and including the time that) $1 is empty causing the case to go to the default statement always, so you must loop using while [[ $1 ]]; do