can't invoke sed properly...

Charles Hallenbeck chuckh at hhs48.com
Tue May 3 10:15:31 EDT 2005


Yes, you must mention the filename on the command line instead of 
redirecting or piping it. My version is 4.1.2, and I am not sure how 
long this option has been available. You are right about the dangers of 
redirecting both input and output using the same file, but I guess if 
you know about the -i option you might not be tempted to do that.

On Tue, 3 May 2005, Laura Eaves wrote:

> This may be a newer implementation of sed.  The one I ran while working on
> the said project (no pun intended) did indeed have a silent buffer limit and
> the bug was a real bear to find but easy to fix -- we just changed to awk,
> which is more flexible and powerful than sed.
> I hadn't heard of the -i option, but I don't deny it exists.
> But my question is this: don't you have to put the file on the command line
> when using -i rather than just redirecting with the shell > sign?
> So you'd presumably have
>    sed -i pattern filename
> and sed would edit filename in place.
> Nice feature.
>
> But note that clobbering an input file by naming it also as the output file
> is a common mistake newbies make with many commands and it is a good idea to
> point it out so the user will beware.
>
> Cheers.
> --le

-- 
The Moon is Waning Crescent (25% of Full)
"Things are in the saddle, and they ride mankind." Ralph Waldo Emerson
Visit my download site at http://www.mhcable.com/~chuckh




More information about the Speakup mailing list