I have this code on my inithome.sh: HOMEDIR=/home/$USER/descomu () {case $* in-ut|--user-tar-dir)     TARHOMEDIR= $2     if test $2 =       then              echo The direction can't be empty              exit      fi-p|--permissions      descomu -p      ;;esacif test $TARHOMEDIR = then      echo Direction of tar-home not specified. Use -ut or --user-tar-di  r for that.      exitelse     if test $* = -p || test $* = --permissions     then            eval $( tar -xvfp $TARHOMEDIR --directory= $HOMEDIR )            if $? -eq 0            then                    echo Sucess                    return 0            else                    echo Fail                    return 1            fi    else            eval $( tar -xvf $TARHOMEDIR -C $HOMEDIR )            if test $? -eq 0            then                    echo Sucess                    exit            else                    echo Fail                    exit            fi      fifi}while test $# -gt 0docase $1 in-ru|--recover-user)      descomu $@      ;;*)      ;;esacdoneI want pass the -ut argument value to a variable named $TARHOMEDIR, but when I do ./inithome.sh -ru -ut PATH the set -u flag tell me that $TARHOMEDIR variable is unassigned. I try with $*, $@, $* and $* in case $foo in but none worked.I could make it work with:descomu () {case $2 in-ut|--user-tar-dir)     TARHOMEDIR= $3     if test $3 =      then              echo The direction can't be empty              exit     fi-p|--permissions     descomu -p     ;;esacBut only work if I have passed only one argument in the correct place, but I have more than one argument and I want put them in random places. Is a problem with IFS variable? In that case, how I declare him?
Pass argument to function with case statement
shell script;arguments;case