Remove last EOL added by awk substitution
This commit is contained in:
parent
ec8e31a946
commit
4cb85271cc
3
snippy
3
snippy
@ -134,6 +134,9 @@ run() {
|
|||||||
-v placeholder="$clipboard_placeholder" \
|
-v placeholder="$clipboard_placeholder" \
|
||||||
'{ gsub(placeholder, clipboard); print }' > "$tmpfile"
|
'{ gsub(placeholder, clipboard); print }' > "$tmpfile"
|
||||||
|
|
||||||
|
# remove last EOL
|
||||||
|
perl -pi -e 'chomp if eof' "$tmpfile"
|
||||||
|
|
||||||
else [[ ${snippet} =~ ^$ ]]
|
else [[ ${snippet} =~ ^$ ]]
|
||||||
${snippet##*$} 2>/dev/null > "$tmpfile" # execute as bashcommand
|
${snippet##*$} 2>/dev/null > "$tmpfile" # execute as bashcommand
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user