Linux錄製並回放終端會話

2021-09-30 20:03:52 字數 1599 閱讀 1658

[student@myhost ~]$ script -t 2> timing.log -a output.session

script started, file is output.session

[student@myhost ~]$ ls

4 aout d downloads findresultsvv log.txt o pictures stderr.txt testdir vimfile.txt

5 b desktop file1 ggg.tar longlisting.txt out public stdout.txt timing.log

a c documents file2 hhh music output.session public_html templates videos

[student@myhost ~]$ cd ..

[student@myhost home]$ cd student/

[student@myhost ~]$ cat a

space:

tab:

[student@myhost ~]$ exit

exit

script done, file is output.session

[student@myhost ~]$ scriptreplay timing.log output.session

[student@myhost ~]$ ls

4 aout d downloads findresultsvv log.txt o pictures stderr.txt testdir vimfile.txt

5 b desktop file1 ggg.tar longlisting.txt out public stdout.txt timing.log

a c documents file2 hhh music output.session public_html templates videos

[student@myhost ~]$ cd ..

[student@myhost home]$ cd student/

[student@myhost ~]$ cat a

space:

tab:

[student@myhost ~]$ exit

以上演示中,-t選項代表將時序資料以stderr形式產生,之後將時序資料匯入timing.log(2> timing.log),-a選項表示將螢幕上出現的內容儲存到哪個檔案裡。

儲存後,我們可以將這兩個檔案放到任意終端上進行回放,但回放的終端必須支援將stderr重定向到檔案(如csh shell就不行),命令"scriptreplay 時序檔案 內容檔案"即可回放。

Linux中錄製並回放終端會話

script和scriptrelay命令可以錄製命令的次序和時序。開始錄製會話終端 錄製 script t 2 timing.log a output.session commands exit 解釋 commands為自己的命令 script命令中 t引數表示將時序資訊匯入stderr。2 正好把...

selenium錄製並回放請求 心得(一)

今天是我第一用selenium錄製指令碼並回放,感覺用起來並不像想象中的那麼簡單,上午遇到的問題到現在才解決,感覺自己學習能力還是不夠的,不過慢慢來,相信很快就可以上手的。我錄製的是mail.10086.cn日曆模組建立活動。1.打 狐瀏覽器,開啟selenium開啟紅色按鈕,開始錄製指令碼 2.登...

Linux下利用script命令錄製並回放終端會話

script 和 scriptreplay script t 2 timescript typescript命令解釋 選項 a 把錄製內容追加的輸出檔案 t 儲存錄製時間節點 q 不顯示script啟動和exit的命令 f 每次操作後都立即重新整理快取。實時寫入檔案時間節點是輸出到 stderr 的...