同时运行2个无限循环

时间:2016-03-14 23:16:22

标签: bash shell if-statement while-loop sh

有没有办法运行RFSniffer./test2.sh而不必中断?

trap './test2.sh' SIGINT
sudo sh -c ./433Utils/RPi_utils/RFSniffer 2>&1 | tee /home/pi/output.txt

这是我的while循环./test2.sh

while read line
do
  if [[ $line =~ "Received 5592512" ]]; then
     echo "Button A was pushed"
  elif [[ $line =~ "Received 5592368" ]]; then
     echo "Button B was pushed"
  elif [[ $line =~ "Received 5592332" ]]; then
     echo "Button C was pushed"
  elif [[ $line =~ "Received 5592323" ]]; then
     echo "Button D was pushed"
  fi
done < output.txt

0 个答案:

没有答案