Revision 848c81d354accbd4b0e05c2ea350c9c6c8182afd authored by simonbing on 23 July 2018, 06:38:28 UTC, committed by simonbing on 23 July 2018, 06:38:28 UTC
1 parent bdadca1
Raw File
try.sh
#!/bin/bash

PIPE=/tmp/catpipe
trap "rm -f $PIPE" exit 1
[[ ! -p $PIPE ]] && mkfifo $PIPE

while true; do
     while read line; do
          case "$line" in
               @exit) rm -f $PIPE && exit 0;;
               @*) eval "${line#@}" ;;
               * ) echo "$line" ;;
          esac
     done <$PIPE
done

exit 2
back to top