I have the following script code:
test.sh
echo "BEGIN"
while read CMD <&1; do
[ -z "$CMD" ] && continue
case "$CMD" in
start)
echo "get_start"
;;
stop)
echo "get_stop"
;;
*)
echo "get_uknown_command"
;;
esac
echo "END";
done
When I run it with:
$./test.sh <input.txt
I get my script locked
input.txt
start
stop
sthh
Why my script is locked? How I can fix that?
BTW: If I enter the data manually then the script will not lock.