#!/bin/bash
#
# Copyright 2022 Joe Block <jpb@unixorn.net>
# License: Apache 2
set -o pipefail
if [[ "$(uname -s)" != 'Darwin' ]]; then
echo 'Sorry, this script only works on macOS'
exit 1
fi
pbpaste | perl -pe 's/\e\[[0-9;]*m(?:\e\[K)?//g' | pbcopy
exit $?