$ cat > nusers #建立文件, 适用 cat 复制终端输入
who | wc -l #嵌入的程序内容, "|" 符号在 who 和 wc 两个程序之间建立管道, who 的输出成为 wc 的输入, 执行结果就是登录人 数目
^D #Ctrl+D 表示 end of file
$ chmod +x nusers #文件赋权, 未赋权文件执行会报 -bash: ./nusers: Permission denied
$ ./nusers #执行测试
[bankdplyop@SYSOPS00013549 study]$ who | wc 19 95 1064 [bankdplyop@SYSOPS00013549 study]$ cat > nusers who | wc -l [bankdplyop@SYSOPS00013549 study]$ ls -lrt total 4 -rw-rw-r-- 1 bankdplyop bankdplyop 12 Sep 3 20:36 nusers [bankdplyop@SYSOPS00013549 study]$ cat nusers who | wc -l [bankdplyop@SYSOPS00013549 study]$ ./nusers -bash: ./nusers: Permission denied [bankdplyop@SYSOPS00013549 study]$ ls -lrt total 4 -rw-rw-r-- 1 bankdplyop bankdplyop 12 Sep 3 20:36 nusers [bankdplyop@SYSOPS00013549 study]$ chmod +x nusers [bankdplyop@SYSOPS00013549 study]$ ./nusers 19