标签:
输入1: [root@250-shiyan rec]# cat record1 #!/bin/bash #Filename:Record.sh dir=/tmp/rec read -p "Please input the session filename: " filename sesfile="$dir/$filename.session" logfile="$dir/$filename.timing.log" if [ -e $sesfile ] then echo "$sesfile is Exsit,Creat session file fault!" read -p "If you want to reload the file? [Y/N]: " flag if [ "$flag" = "Y" ] then rm $sesfile $logfile script -t 2> $logfile -a $sesfile else echo "Nothing to do!" fi else script -t 2> $logfile -a $sesfile fi 输入2: [root@250-shiyan rec]# cat replay1 #!/bin/bash #Filename:Replay.sh dir=/tmp/rec/ read -p "Please input the session filename: " filename logfile="$dir$filename.timing.log" sesfile="$dir$filename.session" if [ -e $sesfile ] then scriptreplay $logfile $sesfile echo else echo "$filename is NOT Exsit!" fi 记录: [root@250-shiyan rec]# bash record1 Please input the session filename: uu Script started, file is /tmp/rec/uu.session [root@250-shiyan rec]# exit exit Script done, file is /tmp/rec/uu.session 回放: [root@250-shiyan rec]# bash replay1 Please input the session filename: uu
标签:
原文地址:http://www.cnblogs.com/createyuan/p/4287388.html