Remove last EOL added by awk substitution

This commit is contained in:
BarbUk 2018-12-22 16:22:43 +04:00
parent ec8e31a946
commit 4cb85271cc

3
snippy
View File

@ -134,6 +134,9 @@ run() {
-v placeholder="$clipboard_placeholder" \
'{ gsub(placeholder, clipboard); print }' > "$tmpfile"
# remove last EOL
perl -pi -e 'chomp if eof' "$tmpfile"
else [[ ${snippet} =~ ^$ ]]
${snippet##*$} 2>/dev/null > "$tmpfile" # execute as bashcommand
fi