Bug 10397 - echo command in .bashrc loads in new less command.
Summary: echo command in .bashrc loads in new less command.
Keywords:
Status: CLOSED DUPLICATE of bug 9443
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: less
Version: 6.2
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bernhard Rosenkraenzer
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-03-28 19:10 UTC by joe_mccarthy
Modified: 2008-05-01 15:37 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-03-30 13:39:14 UTC


Attachments (Terms of Use)

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 ***


Note You need to log in before you can comment on or make changes to this bug.