1
0
Fork 0

bin: Fix pbedit trailing newlines

This commit is contained in:
Jeremy Kaplan 2022-08-04 15:43:20 -07:00
commit 55e3100bfb

View file

@ -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