i command in sed - only one address?

Charles Blair ceblair at ux1.cso.uiuc.edu
Mon Apr 29 23:17:18 AEST 1991


   I would like to put a line before ranges in a file.  Something like

sed '/A/,/B/i\
INSERTED LINE' < file1 > file2

but when I try this, I get an error message saying ``only one address.''
Something like this seems to work when I insert a line before every
line with an A in it (by using /A/ instead of /A/,/B/ )

Charles Blair



More information about the Comp.unix.questions mailing list