File tree Expand file tree Collapse file tree 7 files changed +12
-12
lines changed
Expand file tree Collapse file tree 7 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -10,9 +10,9 @@ def main():
1010 max_score = input_data .get ("max_score" , 2.0 )
1111
1212 # 提取/bin/ps命令的输出
13- # 方法:找到包含"tsh> /bin/ps a "的行,然后获取它后面的内容直到下一个提示符
13+ # 方法:找到包含"tsh> /bin/ps ax "的行,然后获取它后面的内容直到下一个提示符
1414 ps_output = ""
15- ps_command_pattern = r"> /bin/ps a \s*\n"
15+ ps_command_pattern = r"> /bin/ps ax \s*\n"
1616 match = re .search (ps_command_pattern , stdout )
1717
1818 if match :
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ stdout_pattern = "Job \\[\\d+\\] \\(\\d+\\) terminated by signal (2|SIGINT)"
3636
3737[[run .steps ]]
3838type = " input"
39- content = " /bin/ps a "
39+ content = " /bin/ps ax "
4040
4141[[run .steps ]]
4242type = " check"
Original file line number Diff line number Diff line change @@ -13,10 +13,10 @@ def check_ps_output(stdout):
1313 """
1414 lines = stdout .strip ().split ("\n " )
1515
16- # Find the section of output after "/bin/ps a " command
16+ # Find the section of output after "/bin/ps ax " command
1717 ps_output_start = - 1
1818 for i , line in enumerate (lines ):
19- if line .strip () == "/bin/ps a " or line .strip () == "> /bin/ps a " :
19+ if line .strip () == "/bin/ps ax " or line .strip () == "> /bin/ps ax " :
2020 ps_output_start = i + 1
2121 break
2222
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ stdout_pattern = "\\[\\d+\\] \\(\\d+\\) Stopped ./mysplit 4"
5353
5454[[run .steps ]]
5555type = " input"
56- content = " /bin/ps a "
56+ content = " /bin/ps ax "
5757echo = true
5858wait_for_output = true
5959
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ stdout_pattern = "\\[\\d+\\] \\(\\d+\\) Stopped ./mysplit 4"
5353
5454[[run .steps ]]
5555type = " input"
56- content = " /bin/ps a "
56+ content = " /bin/ps ax "
5757echo = true
5858wait_for_output = true
5959
@@ -75,7 +75,7 @@ seconds = 1
7575
7676[[run .steps ]]
7777type = " input"
78- content = " /bin/ps a "
78+ content = " /bin/ps ax "
7979echo = true
8080wait_for_output = true
8181
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ def judge_ps_output(stdout):
1111 # Find the second instance of ps output (after fg command)
1212 ps_instances = []
1313 for i , line in enumerate (lines ):
14- if line .strip () == "tsh > /bin/ps a " :
14+ if line .strip () == "> /bin/ps ax " :
1515 ps_instances .append (i )
1616
1717 if len (ps_instances ) < 2 :
@@ -26,7 +26,7 @@ def judge_ps_output(stdout):
2626 ps_lines = []
2727 for i in range (ps_start , len (lines )):
2828 line = lines [i ].strip ()
29- if line .startswith ("tsh >" ):
29+ if line .startswith (">" ):
3030 break
3131 if line :
3232 ps_lines .append (line )
Original file line number Diff line number Diff line change @@ -8,10 +8,10 @@ def judge_ps_output(stdout):
88 # Convert stdout to lines for easier processing
99 lines = stdout .strip ().split ("\n " )
1010
11- # Find where the ps output starts (after "tsh > /bin/ps a ")
11+ # Find where the ps output starts (after "> /bin/ps ax ")
1212 ps_start = - 1
1313 for i , line in enumerate (lines ):
14- if line .strip () == "tsh > /bin/ps a " :
14+ if line .strip () == "> /bin/ps ax " :
1515 ps_start = i + 1
1616 break
1717
You can’t perform that action at this time.
0 commit comments