I have a program in shell which is reading default values from a file
filename: default
MAN=Value1
MANPD=997
REPPD=P1G6
Now the code calling is
#!/bin/sh
. /home/default
while getopts t:D: name
do
case $name in
t) TYPE=$OPTARG;;
D) PDN=${OPTARG:=$MAN};;
esac
done
echo $TYPE
echo $PDN
echo $MAN
So basically if any value to -D is given PDN gets that, else it gets the value of MAN.. now $MAN is giving an output but $PDN (when not set @ runtime) is not setting itself to $MAN..