Create named pipes (FIFOs) with the given NAMEs.
演示1:
Mkfifo test.log
终端1:
ping 119.75.217.56 >test.log
终端2:
Cat test.log
演示2:
Mkfifo –m 644 test2.log
Mkfifo –m g-w o-rwx test3.log ----去掉组的写权限、其他用户的所有权限。
终端1:
mkfifo -m 644 test2.log
ll test2.log
prw-r--r-- 1 root root 0 08-28 11:52 test2.log
ll >test2.log &
[1] 22721
终端2:
awk '{ print $NF}' <test2.log
16
1.sh
history.sh
oracle
root
test2.log
test.log
[1]+ Done ls --color=tty -l --color=tty > test2.log
转载于:https://blog.51cto.com/hunt1574/975629