Re: [SLUG] searching in "less"

From: Eben King (eben01@verizon.net)
Date: Sat Feb 21 2009 - 15:05:01 EST


On Sat, 21 Feb 2009, Matthew Rogers wrote:

> Eben King wrote:
>> Is there any way to do a case-insensitive search in "less" other than
>> something like
>>
>> /[wW][oO][rR][dD]
>>
>> ?

> Force it all to one case using the lc() function in perl maybe?

Sure, I could do that. I was hoping to be able to do it without faffing
around with the file. program | less is easier (especially if I've already
done it) than aborting less, rerunning progname | lc | less or even progname
| lc > file && less file for one search.

> <rant>
> Maybe I'm a perl fanboy, but usually when I want to do something in the
> shell I can do it with 5 lines of perl in a few seconds, vs. spending 20
> minutes researching the extended functions of all sorts of complex
> non-conforming "shell" programs.
> </rant>

That would be affirmative on the fanboy bit. If I were talking about shell
programming I would have asked about grep. less is interactive. Never seen
or heard of perl used that way. Different tools, etc.

-- 
-eben     QebWenE01R@vTerYizUonI.nOetP     royalty.mine.nu:81

Only two things are infinite, the universe and human stupidity, and I'm not sure about the former." -- Albert Einstein ----------------------------------------------------------------------- This list is provided as an unmoderated internet service by Networked Knowledge Systems (NKS). Views and opinions expressed in messages posted are those of the author and do not necessarily reflect the official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 18:56:03 EDT