Quote:
Originally Posted by dinesh1985
Thanks for your replies ..i ll try it and update
---------- Post updated 06-26-09 at 03:20 AM ---------- Previous update was 06-25-09 at 03:54 AM ----------
I donot want to redirect to any new file. I want to delete the line from the file itself.
I have tried sed -i '3d' to delete the 3rd line. But my shell is not recognizing sed -i.
I have tried sed '3d' <filename> ..it is displaying the file without the 3rd line. But the 3rd line is not permanently deleted. Can anyone please help
|
With a little trick you can redirect the output of
sed into the same file
Code:
sed '3d' file | tee file