⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 printconsole

📁 一个用在mips体系结构中的操作系统
💻
字号:
#!/usr/local/bin/perl5 -w## Copyright (C) 1996-1998 by the Board of Trustees#    of Leland Stanford Junior University.# # This file is part of the SimOS distribution. # See LICENSE file for terms of the license. ### Reconstruct console output from a simos cpu.log file#$pattern = "\\d*";$inputFile = "cpu.log";$i = 0;while ($i<=$#ARGV) {    if ($ARGV[$i] eq "-c") {        $i++;        $pattern =  "$ARGV[$i]";    } elsif ($ARGV[$i] eq "-f") {        $i++;        $inputFile = $ARGV[$i];    } else {        print "usage: printConsole [-c consoleNum] [-f file]\n";        exit;    }    $i++;}foreach $i (0..15) {    $data[$i] = "";}open(INFILE, $inputFile) || die "ERROR: could not open $inputFile";while (<INFILE>) {    if (/^:($pattern):(.)$/o) {        $co = $1;        $ch = $2;                if ($ch eq "
") {            print "$co>  $data[$co]\n";            $data[$co] = "";        } else {            $data[$co] = $data[$co] . $ch;        }    }}foreach $i (0..15) {    if ($data[$i] ne "") {        print "$i>  $data[$i]\n";    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -