I am trying to delete all empty lines after line number 3, till the end of the file:
cat ${File}
1
2
3
4
5
5
6
7
8
9
sed -e '3,${s~^$~~g}' ${File}
1
2
3
4
5
5
6
7
8
9
Observation: No change in the output.
Desired Output
1
2
3
4
5
5
6
7
8
9
Note that all blank lines at the end of file should also be removed.