I'm reading Gitlab's source code to learn more about how it works. In the run
bash script located inside the project root directory, I see the following:
if [ "x$GDK_RUNIT" = "x1" ]; then
...
fi
I know this conditional's purpose is to check if the value of the GDK_RUNIT
envar is set equal to 1
, and to exit with a non-zero return code if that's the case. My question is, what is the difference between the above code and the following:
if ["$GDK_RUNIT" = "1" ]; then
...
fi
In other words, what is the purpose of placing "x" before both the envar name and "1"?
I checked man test
for anything related to x
(since I know if
and test
are functionally equivalent), but all I saw was the -x
flag.
x$GDK_RUNIT
doesn't look like a flag to me, so I assumed the contents of the man
page wasn't relevant.