Quantcast
Channel: Keep all line breaks except the last one using awk - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 2

Answer by Stéphane Chazelas for Keep all line breaks except the last one using awk

$
0
0

You could do it like:

< "$file_path" awk -v x="$first_line" -v y="$second_line"'  NR == x {printf "%s", $0; next}  NR > x && NR <= y {printf "%s", ORS $0}' |  base64 -w0

Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>