In the very beginning of a script stands:
if [ -z $DISPLAY ]
then
DIALOG=dialog
else
DIALOG=Xdialog
fi
I understand, that
$DISPLAY
holds the value of which pseudo-terminal one is attached to[ -z $DISPLAY ]
tests whether $DISPLAY has a value or is an empty string
What is the purpose of $DISPLAY
keeping a value, what is different when it has an empty string?
Why would it be crucial for the further execution of the script to know whether [ -z $DISPLAY ]
is true or false ?
$DISPLAY
expands to at most one word of course) – ilkkachu May 27 '17 at 18:09DISPLAY
. I don't think it usually contains more than one word, but of course someone could set it to anything. Also, it's about X, not pseudoterminals. – ilkkachu May 27 '17 at 19:25