From 125237e4a7cf7e6d2ec28565d4403ab9c9908d85 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Thu, 10 Oct 2019 23:12:02 +0200 Subject: add generic shell helper scripts --- bin/execprim | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 bin/execprim (limited to 'bin/execprim') diff --git a/bin/execprim b/bin/execprim new file mode 100755 index 0000000..39a83f8 --- /dev/null +++ b/bin/execprim @@ -0,0 +1,15 @@ +#!/bin/sh + +# Print primary selection with all special chars to stdout and +# prompt if this should be evaluated + +# Author: Florian Fischer +# License: WTFPL + +! type xclip &>/dev/null && echo "Please install xclip" && exit 1 + +PRIMARY=$(xclip -o) +echo $PRIMARY | cat -A # show special chars +echo -e "\nExecute? (y/N): " +read CHOICE +[[ "$CHOICE" -eq "y" ]] && eval $PRIMARY -- cgit v1.2.3