First-line-only editing, part 2: Portable solutions
Dave Burton
daveb at nostromo.austin.ibm.com
Fri Nov 9 04:56:49 AEST 1990
In article <687 at npdiss1.StPaul.NCR.COM> mercer at npdiss1.StPaul.NCR.COM (Dan Mercer) writes:
|In article <4031 at awdprime.UUCP> daveb at bach.austin.ibm.com (Dave Burton) writes:
|:sed 's/.../.../;1q' < file > outfile
|
|Outfile then only contains first line of file, not the entire file
|with the first line altered.
Ouch! Well, it _does_ edit only the first line. :-)
This line should work much better:
sed '1s/.../.../' < file > outfile
--
Dave Burton
inet: daveb at bach.austin.ibm.com
uucp: cs.utexas.edu!ibmchs!auschs!nostromo!daveb
More information about the Comp.unix.questions
mailing list