Eric on 28 Oct 2009 19:48:56 -0700


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

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



Ben Love wrote:
> * 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:

As Walt noted, I wanted to be sure I was running /usr/bin/less and not
some alias, function, or similar re-direction.

Here is what I'm running:

~$ file /usr/bin/less
/usr/bin/less: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
for GNU/Linux 2.2.0, dynamically linked (uses shared libs), for
GNU/Linux 2.2.0, stripped

I'll try strace later tomorrow - too much stuff to catch up on now.

Tnx
Eric



-- 
#  Eric Lucas
#
#                "Oh, I have slipped the surly bond of earth
#                 And danced the skies on laughter-silvered wings...
#                                        -- John Gillespie Magee Jr

___________________________________________________________________________
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