免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
论坛 程序设计 Shell script??
最近访问板块 发新帖
查看: 991 | 回复: 0
打印 上一主题 下一主题

script?? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-02-12 10:42 |只看该作者 |倒序浏览
script可以记录屏幕的输入输出信息到文件
如下:
# script
Script started, file is typescript
# ls -l
total 16
-rw-r--r--   1 root     root        1150 Feb  8 19:28 OWconfig_test
-rw-r--r--   1 root     other         24 Feb 11 19:26 sh.sh
-rw-r--r--   1 root     other          0 Feb 11 19:27 typescript
# exit
Script done, file is typescript
# cat  typescript
Script started on Wed Feb 11 19:27:28 2004
# ls -l
total 16
-rw-r--r--   1 root     root        1150 Feb  8 19:28 OWconfig_test
-rw-r--r--   1 root     other         24 Feb 11 19:26 sh.sh
-rw-r--r--   1 root     other          0 Feb 11 19:27 typescript
# exit

script done on Wed Feb 11 19:27:34 2004
#

可是怎么用script命令在实现记录一个脚本中的命令输入和回显信息呢?
# cat  script.sh
script
ls -l
exit
# rm typescript
# sh script.sh
Script started, file is typescript
# exit
Script done, file is typescript
total 24
-rw-r--r--   1 root     root        1150 Feb  8 19:28 OWconfig_test
-rw-r--r--   1 oracle   dba           18 Feb 11 19:31 script.sh
-rw-r--r--   1 root     other         92 Feb 11 19:33 typescript
# cat typescript
Script started on Wed Feb 11 19:33:13 2004
# exit

script done on Wed Feb 11 19:33:14 2004
#

请教?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP