Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a small issue with less command (this is happening only on Red Hat). Any time I use it is executing the .tcshrc. There is no alias defined for less. I have one machine running Red Hat and one SUSE, in SUSE everything is fine but not in Red Hat.

# which less
/usr/bin/less

# less abc
Executing .tcshrc

Late edit based on crw comments: env variable is set as: LESSOPEN=|/usr/bin/lesspipe.sh %s and running less -L abc is working without problem,.

share|improve this question

migrated from stackoverflow.com Oct 15 '12 at 14:02

This question came from our site for professional and enthusiast programmers.

    
look into /usr/bin/less and check whether it is a binary or script. I guess your less is an script. –  ahmad Oct 15 '12 at 12:05
    
nope, is not a shell is a binary file. –  alinoz Oct 15 '12 at 12:08
    
What behaviour do you get from running /usr/bin/less abc ? –  crw Oct 15 '12 at 12:23
2  
Thanks. Secondly, is the LESSOPEN env variable defined? -or- What happens when running less -L abc ? –  crw Oct 15 '12 at 13:09
1  
@crw please put your comment as answer, the problem is generated by LESSOPEN environment variable. –  alinoz Oct 15 '12 at 13:20
show 1 more comment

1 Answer

up vote 1 down vote accepted

Is the LESSOPEN env variable defined?
LESSOPEN contains the path or piped-command and a filename placeholder for utilising an "input preprocessor" (filter) before displaying a file in less.

What happens when running less -L abc ?
The -L and --no-lessopen switches disable the input preprocessor.

share|improve this answer
    
the problem was generated by the LESSOPEN, it was set by default to a shell script and that one was lunching a shell. –  alinoz Oct 15 '12 at 17:45
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.