以下のようなログファイルがあります。
874899 root@commands to execute some files
Exit Status : 0
Exit time : Sun May 5 18:19:39 2013
874923 root@commands to execute some files
Exit Status : 2
Exit time : Sun May 5 18:19:42 2013
パターンを見て、その一致したパターンの下の行を返すスクリプトがあります。スクリプトは次のとおりです。
open(FH,'log.txt');
while ($line = <FH>) {
if ($line =~ /Exit Status/) {
print "$line";
print scalar <FH>;
}
}
(この場合は 2 として) に一致し、コマンド (この場合) とを 2 つの個別の変数としてExit status
保存するように、これをどのように行うべきかについての入力が必要です。874923
Exit Time
私はperlの初心者なので、私を訂正してください。