well more correctly: sed '1i\ first line\ second line' filename
Then redirect the output steve -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 10 April 2002 17:57 To: [EMAIL PROTECTED] Subject: RE: How do you pipe text to the top of a file? sed -e '1i\ first line' -e '3i\ second line' filename steve -----Original Message----- From: Werner Puschitz [mailto:[EMAIL PROTECTED]] Sent: 10 April 2002 17:05 To: '[EMAIL PROTECTED]' Subject: RE: How do you pipe text to the top of a file? On Wed, 10 Apr 2002, Ward William E DLDN wrote: > How about this? > > echo test > test.txt.tmp ; cat test.txt test.txt.tmp > test.txt This doesn't work: $ cat test.txt test.txt.tmp > test.txt cat: test.txt: input file is output file You need to use a 3rd file. Try this: echo test | cat - test.txt > new.txt Werner _______________________________________________ Redhat-list mailing list [EMAIL PROTECTED] https://listman.redhat.com/mailman/listinfo/redhat-list _______________________________________________ Redhat-list mailing list [EMAIL PROTECTED] https://listman.redhat.com/mailman/listinfo/redhat-list _______________________________________________ Redhat-list mailing list [EMAIL PROTECTED] https://listman.redhat.com/mailman/listinfo/redhat-list