20 lines
338 B
Bash
Executable File
20 lines
338 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# TODO: Добавить описание и пример работы
|
|
|
|
# TCP
|
|
# coproc nc -l localhost 3000
|
|
|
|
# UnixSocket
|
|
coproc nc -l -U ./app.sock
|
|
|
|
while read -r cmd; do
|
|
case $cmd in
|
|
d) date ;;
|
|
q) break ;;
|
|
*) echo 'Try again?'
|
|
esac
|
|
done <&"${COPROC[0]}" >&"${COPROC[1]}"
|
|
|
|
kill "$COPROC_PID"
|