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

Re: Sed replacement from file



On Sat, Oct 19, 2002 at 03:39:37AM -0700, Issac Trotts wrote:
> perl -pe 's/^replace-this$/line one\nline two\nline three\n/' file1 file2 
> 
>   or
> 
> cat some_file | perl -pe 's/^replace-this$/line one\nline two\nline three\n/' 
> 
> 
> Oddly enough, perl -ep doesn't work.

That's not so odd if you think about it: -e takes an argument, which is
the expression to run. If you say 'perl -ep foo', then 'p' is the
argument to -e.

-- 
Colin Watson                                  [cjwatson@flatline.org.uk]



Reply to: