bin: Fix pbedit trailing newlines
This commit is contained in:
parent
27c9ea39dd
commit
55e3100bfb
1 changed files with 5 additions and 1 deletions
|
|
@ -1,3 +1,7 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
pbpaste | vipe | pbcopy
|
# Somehow, this pipeline ends up with a bunch of newlines at the end that make
|
||||||
|
# pasting it annoying. Use sed to remove all trailing newlines.
|
||||||
|
#
|
||||||
|
# https://stackoverflow.com/a/7359879/2472163
|
||||||
|
pbpaste | vipe | sed -e :a -e '/^\n*$/{$d;N;};/\n$/ba' | pbcopy
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue