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

# 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,.

  • 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

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.

  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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