[Cialug] lsof! grep?

Chris Freeman cwfreeman at gmail.com
Tue Jul 1 15:38:52 CDT 2008


On Tue, Jul 1, 2008 at 10:58 AM, Nathan Stien <nathanism at gmail.com> wrote:

> ...
> I was surprised to find that not everyone does this.  Sometimes you
> can't use single quotes because you need to do $VARIABLE substitution,
> but not usually in a regex.
>

Whenever I find myself in this situation, I simply mix single quotes and
double quotes (or just the exposed variable):

grep '\.'$VARIABLE'so'


> ...
>
> I have a similar habit, but I use \< and \> to get beginning and
> ending word boundaries.  Picked that up from hitting * in vim, which
> takes the word under the cursor and sets the current search regex to
> be '\<foo\>'.
>
> $ grep '\.so\>'
>

<flame on>This is because VIM is the end-all and be-all of editors.</flame
no>

Thank you for teaching me something about VIM today.

Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cialug.org/pipermail/cialug/attachments/20080701/a50fb81d/attachment.html


More information about the Cialug mailing list