I have parsed a curl download with sed commands. I would also like to move the last line in the output file to the top. Can I use sed for this?
How about:
sed '1h;1d;$!H;$!d;G' infile
That works perfectly, thanks!
By awk:
awk '{a[NR]=$0} END {print a[NR]; for (i=1;i<NR;i++) print a}' urfile