CTDP linux 程序员手册 (4.8) 一个管理和读文件的例子
来源:互联网 发布:java多线程的实现 编辑:程序博客网 时间:2024/06/11 19:46
<script type="text/javascript"><!-- google_ad_client = "pub-2416224910262877";google_ad_width = 728;google_ad_height = 90;google_ad_format = "728x90_as";google_ad_channel = "";google_color_border = "E1771E";google_color_bg = "FFFFFF";google_color_link = "0000FF";google_color_text = "000000";google_color_url = "008000";// --></script><script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script>
#!/bin/bash
#
# printst 这个文件打印在"/var/spool/spooldata"目录中的所有子目录中的文件
# 它循环遍历每一个子目录, 查找所有具有粘滞位的文件,如果有粘滞
# 位,这个文件将被发送到打印机,并且粘滞位被清除.
# 文件被发送到哪一个打印机,取决于目录名和配置文件
#
if [ -d /var/spool/spooldata ]; then # 如果spool子目录存在
for dfile in /var/spool/spooldata/*; do # 遍历在spooldata内的所有文件
if [ -d $dfile ]; then # 如果是一个子目录
fname=${dfile#/var/spool/spooldata/} # 参数扩展获得不带路径的文件名
# 根据子目录的名称从配置文件中得到打印机的名称
prname=`grep -i ${fname} /usr/local/etc/spooldata.conf | cut -f2 -d" "`
for ifile in $dfile/*; do # 遍历子目录中的所有文件
if [ -k $ifile ]; then # 如果这个文件带有粘滞位
lpr -P$prname $ifile # 打印这个文件
chmod -t $ifile # 清除粘滞位
fi
done
fi
done
fi
while [ 1 ]
do
sleep 60
.
.
done
print1 lp1
print2 lp2
print3 lp3
<script type="text/javascript"><!--google_ad_client = "pub-2416224910262877";google_ad_width = 728;google_ad_height = 90;google_ad_format = "728x90_as";google_ad_channel = "";google_color_border = "E1771E";google_color_bg = "FFFFFF";google_color_link = "0000FF";google_color_text = "000000";google_color_url = "008000";// --></script><script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script>
- CTDP linux 程序员手册 (4.8) 一个管理和读文件的例子
- CTDP linux 程序员手册 (4.6) 一个循环脚本的例子
- CTDP linux 程序员手册 (4.9) 一个 makefile 脚本的例子
- CTDP linux 程序员手册 C和C++编程(12)一个 Linux 串口测试例子
- CTDP linux 程序员手册 C和C++编程(8)文件和目录的 POSIX 选项
- CTDP linux 程序员手册 (1)
- CTDP linux 程序员手册 C和C++编程(4)Linux POSIX 系统的兼容型
- CTDP linux 程序员手册 C和C++编程(6)更多的Linux POSIX测试
- CTDP linux 程序员手册 (4.3) 控制和迭代
- CTDP linux 程序员手册 (4.5)Shell 的能力
- CTDP linux 程序员手册 (4.7) 调整时间的程序
- CTDP linux 程序员手册 (3) Linux 信号
- CTDP linux 程序员手册 C和C++编程(9)Linux 线程
- CTDP linux 程序员手册 C和C++编程 调试 Linux 程序
- CTDP linux 程序员手册 C和C++编程(1)简介
- CTDP linux 程序员手册 C和C++编程(2)POSIX 编号
- CTDP linux 程序员手册 C和C++编程(3)POSIX 功能性
- CTDP linux 程序员手册 C和C++编程(5)其他一些系统限制
- 最优的N最短路径的初分结果选取方式(完善中)
- 几个学习网站
- 设计模式之单例模式
- CSDN 未来网站内容Tag架构猜想
- win2003安装SQL2000,系统提示之前有挂起的安装操作。
- CTDP linux 程序员手册 (4.8) 一个管理和读文件的例子
- 使用VTD-XML简化XML处理-克服DOM及SAX缺点的新选择
- Eclipse 运行命令行参数大全
- JSP验证码getOutputStream异常的解决方法
- datagrid导出为excel的简单代码
- 王老师 C++ 类的继承
- 常用英语习惯语
- 研究directshow的blog
- FlashGet