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

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

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

View Article



Keep all line breaks except the last one using awk

How do I modify this line below to capture the content between two lines without the trailing line break?interesting="$(awk "NR >= $first_line && NR <= $second_line" $file_path | base64...

View Article
Browsing latest articles
Browse All 2 View Live




Latest Images