[Techtalk] ed < file
malcolm at commsecure.com.au
Wed Nov 13 22:40:19 EST 2002
On Wed, Nov 13, 2002 at 09:40:27AM +0100, Dan Richter wrote:
> >The above command has the effect of passing lots of different arguments
> >to ed, no passing it stuff on stdin.
> >What you want to do is:
> >(cat <<EOF; ) | ed filename
> I don't get this. Isn't "cat" reading from stdin in this example? "cat"
> with a command-line argument refers to a file. So why is it stdin for "cat"
> and not for "ed"?
Err .. yeah. :-(
You are correct and I am completely wrong. The 'ed' example should work.
An in fact, if file 'foo' contains
ed foo <<EOF
leave 'foo' looking like
So the problem lies elsewhere. Sorry for misleading you ... I should not
have answered so quickly, but your problem seemed to fit a pattern
wherer the 'cat' solution normally goes. Next time I will read more
If it walks out of your refrigerator, LET IT GO!!
More information about the Techtalk