When I try to use those environment variables, I get an empty string:
$ $PAGER some_file; bash: some_file: command not found $
I tested a few things:
$ echo $PAGER; $ man man; ## Here it's using less(1) $ export PAGER; $ man man; ## Still using less(1) $ PAGER=''; $ echo $PAGER; $ man man; ## Here it uses cat(1) $ export PAGER; $ man man; ## Here it uses cat(1), too $ unset PAGER; $ man man; ## Here it uses less(1) again
Why? And how can I use those variables?
env |grep PAGER shows nothing.
My system is Debian 11 (testing)
My intention is to write a script that relies on a pager.
less, but I can't guarantee it'll be present, so I'd like to use
Aren't those variables supposed to be always present so that I can rely on them?