記錄輸出結果工具-script

jlttt發表於2008-06-26

今天轉到eygle的網站上,學到一個好用的工具script,可以將接下來所做的操作都記錄到一個叫typescript的檔案裡。

[root@xh root]# script
Script started, file is typescript
[root@xh root]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 39G 5.6G 32G 16% /
/dev/sda1 99M 9.2M 85M 10% /boot
none 291M 0 291M 0% /dev/shm
[root@xh root]# ls
1.dbf anaconda-ks.cfg install.log log monitor.sh time.sh
1.sh dd.sh install.log.syslog log.txt Shareplex_Chk.sql typescript
[root@xh root]# su - oracle
[oracle@xh oracle]$ sqlplus '/as sysdba'

SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jun 26 17:10:25 2008

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 167772160 bytes
Fixed Size 1218316 bytes
Variable Size 88082676 bytes
Database Buffers 75497472 bytes
Redo Buffers 2973696 bytes
Database mounted.
Database opened.
SQL> select status from v$instance;

STATUS
------------
OPEN

SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@xh oracle]$ exit
logout
[root@xh root]# ls
1.dbf anaconda-ks.cfg install.log log monitor.sh time.sh
1.sh dd.sh install.log.syslog log.txt Shareplex_Chk.sql typescript
[root@xh root]# cat typescript
[root@xh root]# exit
exit
Script done, file is typescript
[root@xh root]# cat

爆好用~~~~

[@more@]

[root@xh root]# more typescript
Script started on Thu 26 Jun 2008 05:09:50 PM CST
[root@xh root]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 39G 5.6G 32G 16% /
/dev/sda1 99M 9.2M 85M 10% /boot
none 291M 0 291M 0% /dev/shm
[root@xh root]# ls
1.dbf anaconda-ks.cfg install.log log monitor.sh
time.sh
1.sh dd.sh install.log.syslog log.txt Shareplex_Chk.sql
typescript
[root@xh root]# su - oracle
[oracle@xh oracle]$ sqlplus '/as sysdba'

SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jun 26 17:10:25 2008

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 167772160 bytes
Fixed Size 1218316 bytes
Variable Size 88082676 bytes
Database Buffers 75497472 bytes
Redo Buffers 2973696 bytes
Database mounted.
Database opened.
SQL> select status from v$instance;

STATUS
------------
OPEN

SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@xh oracle]$ exit
logout
--More--(75%)
[root@xh root]# ls
1.dbf anaconda-ks.cfg install.log log monitor.sh
1;32mtime.sh84%)
1.sh dd.sh install.log.syslog log.txt Shareplex_Chk.sql
mtypescript(92%)
[root@xh root]# cat typescript
[root@xh root]# exit
exit

Script done on Thu 26 Jun 2008 05:11:40 PM CST
[root@xh root]#

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9533994/viewspace-1006163/,如需轉載,請註明出處,否則將追究法律責任。

相關文章