summaryrefslogtreecommitdiffstats
path: root/clipboard-singlify
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2018-06-23 22:23:16 +0200
committerFlorian Pritz <bluewind@xinu.at>2018-06-23 22:23:16 +0200
commitff08764db7d5396b7ebe7bf78ff9fa0a3c512f30 (patch)
treede3b6e230c53fd21dc528e2ab34046d83a2c8bde /clipboard-singlify
parentf0d01c040a56fe249802628e0e9e82fd5ac64149 (diff)
downloadbin-ff08764db7d5396b7ebe7bf78ff9fa0a3c512f30.tar.gz
bin-ff08764db7d5396b7ebe7bf78ff9fa0a3c512f30.tar.xz
clipboard-singlify: Add doc and improve regex by using \h
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'clipboard-singlify')
-rwxr-xr-xclipboard-singlify4
1 files changed, 3 insertions, 1 deletions
diff --git a/clipboard-singlify b/clipboard-singlify
index 75d09e0..aa2dcb1 100755
--- a/clipboard-singlify
+++ b/clipboard-singlify
@@ -1,3 +1,5 @@
#!/bin/bash
-xclip -o | perl -pe 'BEGIN{undef $/;} s#[\t ]*\n[\t ]*# #mg; s#^\s*##; s#\s*$##' | xclip
+# Remove linebreaks and indentation in clipboard content. This makes the content safe to paste in e.g. a chat window
+
+xclip -o | perl -pe 'BEGIN{undef $/;} s#\h*\n\h*# #mg; s#^\s*##; s#\s*$##' | xclip