Thank you for testing that for me.
While I was waiting for an answer I think I found the solution to my problem.
In my original script i have several variables that depend on one variable so when i update the value of one, i need to update all the others that has used that variable?
Meaning if I do this
Code:
VAR1=/tmp
VAR2=$VAR1/$USER
while test $# -ge 1
do
case "$1" in
-dd=* | --dest_dir=* ) VAR1=`echo $1 | sed 's/[-a-z_]*=//'`; shift;;
* ) echo "something something"; exit 1;;
esac
done
echo "$VAR1 and $VAR2"
The output of $VAR2 would be the same with or without the -dd= option at the command line.
So in order for this to work i would have to exchange this
Code:
-dd=* | --dest_dir=* ) VAR1=`echo $1 | sed 's/[-a-z_]*=//'`; shift;;
for this
Code:
-dd=* | --dest_dir=* ) VAR1=`echo $1 | sed 's/[-a-z_]*=//'`; VAR2=$VAR1/$USER; shift;;
I'm very sorry for wasting your time, been sitting here for so long that i didn't see that.