代码块重定向
#代碼塊重定向的作用范圍,就是這個代碼塊
#!/bin/bashls?/etc?>?log.etc????
maxline=$(wc?-l?<?log.etc)for?filename?in?`seq?$maxline`???#使用seq產生參數列表
doread?filenameif?[?"$filename"?=?"rc.d"?];thenbreakelselet?"count+=1"fi
done?<?log.etc??????????#標準輸入重定向到log.etc
echo?"$count?times?read"[root@server100?test]#?./re.sh?
195?times?read
轉載于:https://blog.51cto.com/muahao/1531929
總結
- 上一篇: 笔记:Java中的单例设计模式
- 下一篇: 修改注册表 为右键添加快捷命令