You should have said you want Perl
Code:
perl -ne 'print "$_\n" if s:</para>:</p>:' t.t
</p>
</p>
Incidentally, you should use this header
Code:
#!/usr/bin/perl -w
use strict;
& 3-arg open and check open did not fail
[code]
open(KFILE, "<", "kfile.txt" ) or
die "Can't open kfile: $!\n";
# close
close(KFILE) or die "Can't close kfile: $!\n";
[code]
Note the use of 'or' not '||'; its precedence thing.
I highly recommend you bookmark/read
http://perldoc.perl.org/
http://www.perlmonks.org/?node=Tutorials
http://www.tizag.com/perlT/index.php