Going through the Bash reference guide, trying to understand nullglob and bash in general. But when I try:
$shopt -q nullglob
From the description of the
-q option in the Bash
Suppresses normal output; the return status indicates whether the optname is set or unset.
$? contains the status of the last command.
shopt -q nullglob echo $?
That will print
0 if it's set,
1 if it's not set.
But it's more useful in an
if shopt -q nullglob then echo nullglob is set else echo nullglob is not set fi