-----BEGIN PGP SIGNED MESSAGE----- Why not just echo > text.file and echo >> text.file??
Or maybe use this to write a small C program that will write the text file? Just kidding. I know all these things play important roles. I just don't believe in buying a convertible and never putting the top down or buying a Corvett and driving it at half the speed limit all the time. I guess the years I spent in M.I. using the line editors on the unix systems we used broke me. When they finally put a full screen editor in I was born again. Anyway. To each his own. On 12-Apr-97 Richard Sharman wrote: >Jason Costomiris writes: > > On 11 Apr 1997 [EMAIL PROTECTED] wrote: > > > > > > THE MIGHTY ED HAS SPOKEN!!! > > > > > > Teco. > > > > Bwah. Real men edit with cat, sed, awk, head and tail. Better yet, they > > write directly to the disk with a hex sector editor. > > > > >sed, head AND tail? Isn't that a bit extravagent? >head -4 f == sed 4q f > >Actually, if you have awk I don't think you need sed. > > >Here's head and tail with awk > > > >Head() { > awk "(NR > $1) {exit} {print}" $2 >} > >Tail() { > n=`wc -l $2 | awk "{print \\$1 - $1}"` > awk "( NR < $n ) {next} {print}" $2 >} > >The syntax is a little different, use Head 4 f instead of head -4 f > > >% Head 4 f >line 1 >line 2 >line 3 >line 4 >% Tail 4 f >line 6 >line 7 >line 8 >line 9 >line 10 >% > >If you have tac, tail is much easier: > >% tac f | Head 4 - | tac >line 7 >line 8 >line 9 >line 10 >% > Have a good one. - ---------------------------------- Rick Jones E-Mail: Rick <[EMAIL PROTECTED]> Date: 12-Apr-97 Time: 01:01:39 - ---------------------------------- -----BEGIN PGP SIGNATURE----- Version: 2.6.2 iQCVAwUBM08XMwi+Ph+i3TgpAQGirgP/fPV+2kOc9llx8DRIS2aXnISPRs9SAFrC +oVSxEEGyGq6XKbYlpHaKtzBim1OaO9Jd2va6kRyqJpXCfBlWd569AuGfLf7D6nw nMVxg3xskpG2Ki9RohZBXaQf/vPnbmscCSBZGrL4PgJgQG4ljmQVtnkO2zTmOV0W vftZ9kLGC6o= =ezp+ -----END PGP SIGNATURE-----