Skip to content

Instantly share code, notes, and snippets.

@wildente
Created September 27, 2017 11:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wildente/3c4f1db1c01541bc8489c25a92d08d7a to your computer and use it in GitHub Desktop.
Save wildente/3c4f1db1c01541bc8489c25a92d08d7a to your computer and use it in GitHub Desktop.
#!/bin/bash
#
MYSHELL=/bin/bash
HISTORYFILE=/var/tmp/bashcmd.rofi.list
TERMINAL=/usr/bin/urxvt
if [[ -z "$@" ]]
then
sort ${HISTORYFILE} 2>/dev/null || echo "just issue command being executed via ${MYSHELL}"
else
grep -q "^$@$" ${HISTORYFILE} &>/dev/null || echo "$@" >> ${HISTORYFILE}
coproc ( ${MYSHELL} -c "$@" &> /dev/null )
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment