Bash 管道发送命令作为另一程序的输入-电报
我正在从终端运行Bash 管道发送命令作为另一程序的输入-电报,bash,shell,terminal,pipe,telegram,Bash,Shell,Terminal,Pipe,Telegram,我正在从终端运行电报cli。 我想执行像contact_list这样的命令,并通过另一个脚本管理它们的输出。 我像这样运行电报cli管道,在另一个终端中运行脚本读取和执行.sh #!/bin/bash pipe="/home/me/Download/tg/bin/pipe" while true do input=$(cat<"$pipe") if [[ $input =~ exit ]] then
电报cli
。
我想执行像contact_list
这样的命令,并通过另一个脚本管理它们的输出。
我像这样运行电报cli
管道,在另一个终端中运行脚本读取和执行.sh
#!/bin/bash
pipe="/home/me/Download/tg/bin/pipe"
while true
do
input=$(cat<"$pipe")
if [[ $input =~ exit ]]
then
exit 0
else
echo "output found"
fi
done
#/bin/bash
pipe=“/home/me/Download/tg/bin/pipe”
虽然是真的
做
input=$(cati我应该也使用我的方法来管理输出吗?@pynexj我不知道我应该如何使用.sockfile@pynexj这段代码应该做什么?这是它的输出:bash-4.3$exit它似乎不正确