shell 单sh管道

  1 #!/bin/sh
  2 mkfifo tmpfile
  3 exec 6<>tmpfile
  4 
  5 ping 192.168.6.77>&6 &
  6 i=0
  7 while [ $i -le 10 ]
  8 do
  9     read a<&6
 10     date
 11 #   echo $a
 12     i=`expr $i + 1`
 13 done
 14 exec 6>&-
 15 
 16 rm tmpfile

猜你喜欢

转载自blog.csdn.net/u012206617/article/details/82774013