After the 6.2 upgrade I found that less did not work. It seems that a command I had in my local .bashrc file was interfering with the less command. In my .bashrc file I had a echo command that would display a message on start up. ex: echo 'Having fun yet?' When I tried to less a file, I would only get the echoed line. I rem'ed it out of my .bashrc file and now less command works normally. The other workaround was to type ls | less and pipe it through less. This worked as well. When I type env, there is a line at the top stating: LESSOPEN=|/usr/bin/lesspipe.sh %s and the contains of the script in /usr/bin is: ------------------------------------------------------------------- > #!/bin/sh > # > # To use this filter with less, define LESSOPEN: > # export LESSOPEN="|/usr/local/bin/lesspipe.sh %s" > > lesspipe() { > case "$1" in > *.tar) tar tvvf $1 2>/dev/null ;; # View contents of .tar and .tgz > files > *.tgz) tar tzvvf $1 2>/dev/null ;; > *.tar.gz) tar tzvvf $1 2>/dev/null ;; > *.tar.bz2) bzip2 -dc $1 | tar tvvf - 2>/dev/null ;; > *.tar.Z) tar tzvvf $1 2>/dev/null ;; > *.tar.z) tar tzvvf $1 2>/dev/null ;; > *.Z) gzip -dc $1 2>/dev/null ;; # View compressed files correctly > *.z) gzip -dc $1 2>/dev/null ;; > *.gz) gzip -dc $1 2>/dev/null ;; > *.bz2) bzip2 -dc $1 2>/dev/null ;; > *.zip) unzip -l $1 2>/dev/null ;; > *.rpm) rpm -qpivl $1 2>/dev/null ;; # view contents of .rpm files > *.1|*.2|*.3|*.4|*.5|*.6|*.7|*.8|*.9|*.n|*.man) FILE=`file -L $1` ; # > groff src FILE=`echo $FILE | cut -d ' ' -f 2` > if [ "$FILE" = "troff" ]; then > groff -s -p -t -e -Tascii -mandoc $1 > fi ;; > esac > } > > lesspipe $1
I am using tcsh, with an echo command in my .cshrc. Less is broken in the same way. It seems to me this bug and bug #9443 are about the same problem.
*** This bug has been marked as a duplicate of 9443 ***