- 论坛徽章:
- 0
|
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
#
请教? |
|