Search Results

Search: Posts Made By: uiop44
2,568
Posted By uiop44
solved
Found via the infamous sed one-liners file.



# delete last 2 lines of file

sed 'N;$!P;$!D;$d' < file
printf "This is the new line 4\n"
printf "\n"



---------- Post updated at 08:36...
2,568
Posted By uiop44
sed question - change 2d to last line in file
The file is repeating blocks of text separated by a blank line. Some of the lines are unique.

e.g.:

This is unique line
This is line 2
This is line 3
This is line 4

This is unique line...
Showing results 1 to 2 of 2

 
All times are GMT -4. The time now is 01:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy