help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] History Expansion (J.B.)


From: doark
Subject: Re: [Help-bash] History Expansion (J.B.)
Date: Thu, 28 Jan 2016 20:03:30 -0500

> Hi folks. Trying to sort out how to use word substitution on history 
> events in this one specific case-

> Say I have this long command:
> tailf -n 1 /some/really/long/path/to/a/logfile | grep -iw 
> "some\|neat\|things\|to\|grep"
> And now i want to run that command on a different log file, but this 
<snip>

I'm not too clever with history. I find that I don't use it that much, if
I did I'd be using zsh, not bash (they have a much more evolved history
setup).
Also, your command will not exit until you terminate it manually, that's
what tailf and tail do, so I'm confused as to why your expecting to read
multiple file in since your command entails that you intend to monitor
the one log file for sometime.
That being said, if your just looking to play with the history rreally
quick try UppArrow, Ctrl-w, (edit the part you want), Ctrl-y (to add the
stuff you killed).
If you want to get one line from each file and wait for more whilst
grep'ing those lines you could do.
tailf -n1 /some/really/long/path/to/a/logfile \
/some/other/really/long/path /and/now/a/third/path \
| grep -iw "some\|neat\|things\|to\|grep"
OR even better (and here's the fun bit most people miss), there are
cool tools out there to do exactly what you are trying to do. Try:
http://simple-evcorr.sourceforge.net/
Or
http://sagan.quadrantsec.com/

I apologize if I've read too far into what you've written, and so have
not answered what you are asking. I have tried to be exhaustive.

Sincerely, David



reply via email to

[Prev in Thread] Current Thread [Next in Thread]