[plug] Insert one file into another

James Devenish devenish at guild.uwa.edu.au
Mon Dec 8 16:39:23 WST 2003


In message <3FD43784.6070600 at leftclick.com.au>
on Mon, Dec 08, 2003 at 04:34:12PM +0800, Ben New wrote:
> cat file1 | sed -e '/>>>>.*/ r file2' | sed -e '/>>>>.*/ d'
> I'm sure the above can be achieved in only one call to sed...

AFAIK the '-e' option is available so that you can do this:
> cat file1 | sed -e '/>>>>.*/ r file2' -e '/>>>>.*/ d'

If you were to do two separate commands, you'd just use:
> cat file1 | sed '/>>>>.*/ r file2' | sed '/>>>>.*/ d'

<shrug/>





More information about the plug mailing list