Ben Love on 28 Oct 2009 19:21:46 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] odd bash and/or less behavior


* Eric (eric@lucii.org) wrote:
> sean finney wrote:
> > On Wed, Oct 28, 2009 at 06:20:44PM -0400, Eric wrote:
> >   
> >> /usr/bin/less index.html
> >>
> >> ...results in the screen flashing the less "usage" text rapidly by
> >> followed by an immediate exit and the screen appears unchanged. 
> >> (if I wanted "cat >/dev/null" I would have typed: cat > /dev/null !!)
> >>
> >> Even stranger, after that there is a file in the pwd entitled "erver:"
> >> that contains some control characters followed by the less help file.
> >>     
> >
> > do you have any of the LESSFOO variables set? i.e.:
> >
> > env | grep LESS
> >
> >
> > 	sean
> >   
> 
> This is what I found:
> 
> LESSOPEN=| /usr/bin/lesspipe %s
> LESSCLOSE=/usr/bin/lesspipe %s %s
> 
> I have no idea what they are but unsetting them does not change the
> behavior.
> 
> Also, it happens for my login and root as well.
> 
> I'm using xterm via ssh.  Nothing extraordinary about the xterm settings
> - seems to work for every other system I log into.
> 

Have you tried:
 $ file /usr/bin/less
to make sure it wasn't replaced with a shell script that does something
funny?

Also, borrowing from some PLUG advice given earlier today, have you
tried:
 $ strace /usr/bin/less
to see what config files it might be using.  Since it happens with root,
it's probably not a user-specific config, but something like
/usr/bin/.sysless or /etc/sysless.

I am curious why you're using /usr/bin/less to invoke it though.
Typically, /usr/bin should be in your $PATH.

Ben

-- 
Ben Love
blove+signature (at) kylimar.com  ||  ASCII ribbon campaign - ()
http://www.kylimar.com/           ||   against HTML e-mail  - /\

Attachment: signature.asc
Description: Digital signature

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug