Bug 10397

Summary: echo command in .bashrc loads in new less command.
Product: [Retired] Red Hat Linux Reporter: joe_mccarthy
Component: lessAssignee: Bernhard Rosenkraenzer <bero>
Status: CLOSED DUPLICATE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2CC: luca.bonomi, thainm
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-03-30 13:39:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description joe_mccarthy 2000-03-28 19:10:35 UTC
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

Comment 1 Luca Bonomi 2000-03-30 13:39:59 UTC
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.

Comment 2 Bernhard Rosenkraenzer 2000-07-26 18:42:23 UTC

*** This bug has been marked as a duplicate of 9443 ***