Closed 4kbyte closed 5 months ago
In Ubuntu 24_04 there is a default .bashrc file. There is a line to do the same for another version of lesspipe. I t was not present yet in Ubuntu 22_04. I changed my .bashrc to contain
# make less more friendly for non-text input files, see lesspipe(1) [ -x /usr/local/bin/lesspipe.sh ] && eval "$(SHELL=/bin/sh lesspipe.sh)"
The fix is self-evident as a matter of syntax. With the previous instruction to
eval lesspipe.sh
, the shell will executelesspipe.sh
but simply echo its result to stdout. To setLESSOPEN
the output needs to be eval'd, so capture it with the shell's $() command substitution.Demonstration:
Tested with GNU bash, version 5.1.16 (and a busybox
sh
).