输入1: [[email protected]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: [[email protected]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 记录: [[email protected]250-shiyan rec]# bash record1 Please input the session filename: uu Script started, file is /tmp/rec/uu.session [[email protected]250-shiyan rec]# exit exit Script done, file is /tmp/rec/uu.session 回放: [[email protected]250-shiyan rec]# bash replay1 Please input the session filename: uu
时间: 2024-10-11 05:06:52