Chinaunix

标题: script命令 [打印本页]

作者: lejianger    时间: 2006-06-28 09:38
标题: script命令
script命令,各位高手有熟悉的吗?怎么能隐藏掉typescript文件名?为什么同一个用户telnet登录两次,只能运行一个script,有知道的麻烦帮指导一下,谢谢!
作者: race    时间: 2006-06-28 09:40
你不会man 一下script吗?
作者: lejianger    时间: 2006-06-28 09:43
看帮助了,它只有一个-a 的参数,是改变所存文件名的,没写别的。
作者: lejianger    时间: 2006-06-28 09:44
SYNOPSIS
     script [ -a ]  [ filename ]

DESCRIPTION
     script makes a record of everything printed on your  screen.
     The record is written to filename. If no file name is given,
     the record is saved in the file typescript.

     The  script command forks and creates a sub-shell, according
     to  the  value  of   $SHELL,  and records the text from this
     session. The script ends when the forked shell exits or when
     CTRL-D is typed.

OPTIONS
     -a    Append the session record  to  filename,  rather  than
           overwrite it.
作者: race    时间: 2006-06-28 09:51
script aaa 就保存成aaa
script bbb就保存成bbb
-a是添加到某个文件的尾部。
建议再仔细阅读一下 man script
作者: lejianger    时间: 2006-06-28 09:51
看看帮助,-a是追加记录,描述中The script ends when the forked shell exits or when
     CTRL-D is typed的意思是不是,script子shell存在了,再启script 就会结束,所以同一个用户登录两次,只能记录后一个登录?高手指点!
作者: lejianger    时间: 2006-06-28 09:56
明白了,不用-a这个参数,解决了登录两次记录一次的问题,谢谢版主的提醒!麻烦能否隐藏所存名?




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2