#!/bin/bash # 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