[TAG] Triggering one of several options with Juk and KHotkeys
Ben Okopnik
ben at callahans.org
Mon Jul 5 22:17:52 MSD 2004
On Mon, Jul 05, 2004 at 11:57:00AM -0400, Jay R. Ashworth wrote:
> On Sun, Jul 04, 2004 at 07:39:17PM -0400, Ben Okopnik wrote:
> > ps aux|grep '[j]uk'
> > Will ignore the 'grep' line every time. Why? Well...
>
> I'd forgotten this; handy. Only works, of course, if the argument to
> grep is a literal. Well, more accurately, it's even harder to
> understand (and possibly might break other things) if you put it in a
> variable...
You're right: it can be made to work but would Not Be Conducive to
Understanding. Something like
----------------------------------------------------------------
# YANETUT
first=${var:0:1}
last=${var:1}
ps ax|grep "[$first]$last"
----------------------------------------------------------------
Ugh.
<http://okopnik.freeshell.org/acronyms.cgi?string=YANETUT>
* Ben Okopnik * okopnik.freeshell.org * Editor-in-Chief, Linux Gazette *
-*- See the Linux Gazette in its new home: <http://linuxgazette.net> -*-
More information about the TAG
mailing list