I've been reading through the bash
man page, and reading through scripts on my system (CentOS 6.7), looking up things in the bash
man page as I go. It's a great exercise; I learned, for instance, how /etc/profile
checks if the -i
option is set when there are actually no options in the positional parameters (so getopts
wouldn't work).
However, the following line has me totally stumped; I can't find anything in the bash
man page that explains what it could be doing:
LESSOPEN="${LESSOPEN-||/usr/bin/lesspipe.sh %s}"
(This is a portion of a line in /etc/profile.d/less.sh
.)
Am I just missing something in man bash
?
Yes, I was missing something in man bash
: Above the explanation for ${parameter:-word}
, it says Omitting the colon results in a test only for a parameter that is unset.
This was the missing piece. (And is not covered in the "possible duplicate" question, by the way.)
The fact that the default value being assigned was the name of a script after an "or" operator only added to my confusion! :)
||commandname %s
in theLESSOPEN
environment variable can be read about atLESS='+/^INPUT PREPROCESSOR' man less
. As I learned when researching unix.stackexchange.com/a/396400/135943.