Re: Scripting Additions: Embracing the Horror of Unix
Re: Scripting Additions: Embracing the Horror of Unix
- Subject: Re: Scripting Additions: Embracing the Horror of Unix
- From: John W Baxter <email@hidden>
- Date: Fri, 1 Feb 2002 22:47:27 -0800
At 13:18 +1100 2/2/2002, Timothy Bates wrote:
>
I would use grep, but I can't get it to not want a file as input.
It takes standard input in the absence of a file:
[fox:~] john% echo "This is a test" | grep This
This is a test
Or, slightly less uninteresting (only slightly):
[fox:~] john% history | grep This
152 22:40 echo "This is a test" | grep this
153 22:41 echo "This is a test" | grep This
154 22:42 history | grep This
In the absence something put onto standard input, it--when run
interactively--takes keyboard input:
[fox:~] john% grep This
this is a test
This is a test
This is a test
So is this
And This
And This
(About the only use I have made of that is as a quick test of a proposed
regular expression. I propose far more of the darn things than I can use.
;-( )
--John
--
John Baxter email@hidden Port Ludlow, WA, USA