Or:
"${VHOME:-Empty, use this}"
radoulov
Junior Poster in Training
54 posts since Feb 2007
Reputation Points: 10
Solved Threads: 5
bash 3.2.33(18)$ :"${VHOME:-$(echo "I'm your code">pippo)}"
bash 3.2.33(18)$ cat pippo
I'm your code
radoulov
Junior Poster in Training
54 posts since Feb 2007
Reputation Points: 10
Solved Threads: 5
Or, if you prefer:
bash 3.2.33(18)$ unset VHOME
bash 3.2.33(18)$ [ ! -n "$VHOME" ]&&echo '$VHOME is unset or null'||echo '$VHOME is:' $VHOME
$VHOME is unset or null
bash 3.2.33(18)$ VHOME=a
bash 3.2.33(18)$ [ ! -n "$VHOME" ]&&echo '$VHOME is unset or null'||echo '$VHOME is:' $VHOME
$VHOME is: a
radoulov
Junior Poster in Training
54 posts since Feb 2007
Reputation Points: 10
Solved Threads: 5