diff --git a/snippy b/snippy index 3ce3629..5f6d7a1 100755 --- a/snippy +++ b/snippy @@ -6,6 +6,8 @@ # . {clipboard} placeholder to use current clipboard in snippet # . {cursor} placeholder to place the cursor # . ##noparse header in snippet to not parse +# . execute command begining by $ +# # augmented by "opennomad": https://gist.github.com/opennomad/15c4d624dce99066a82d # originally written by "mhwombat": https://bbs.archlinux.org/viewtopic.php?id=71938&p=2 # Based on "snippy" by "sessy" @@ -88,8 +90,8 @@ run(){ content="$(bashdown < "${DIR}/${FILE}")" fi printf "%s" "$content" > $TMPFILE - else - ${FILE} &> $TMPFILE # execute as bashcommand + else [[ ${FILE} =~ ^$ ]] + ${FILE##*$} 2>/dev/null > $TMPFILE # execute as bashcommand fi local current_clip cursor