1 #!/bin/bash 2 set -x 3 USER=$1 4 devices=`ls /dev/pts/* -l | awk '{print $3, $10}'| grep $USER | awk '{ print $2}'` 5 for dev in $devices 6 do 7 cat /dev/stdin > $dev 8 echo $dev 9 done
test中 测试下。。。
./wall.sh user < test
标签:shell,devices,发送,awk,dev,print,重任,USER From: https://www.cnblogs.com/axjlxy/p/17219913.html