小编rah*_*huL的帖子

为什么我的 bash 脚本被“杀死”了?我该如何防止?

我编写了一个 bash 脚本来针对测试套件测试学生编写的 C 程序。由于某种原因,脚本在一段时间后被杀死。我是 bash 脚本的新手,直到现在还没有找到原因。这是脚本。

#!/bin/bash
ulimit -t 1
tests_dir=tests
run_dir=tests
find . -name "*.c" | while read cfile; do rm a.out &> /dev/null; gcc "$cfile" -lm -w &> /dev/null;
if [ ! -f a.out ]; 
then 
    echo "$cfile did-not-compile" >> "$run_dir/results.out";
else
    find "$tests_dir" -name "in*.txt" | while read testin; do echo "running $testin on $cfile"; 
    rm test.out &> /dev/null; 
    rm space_less_testout &> /dev/null;
    LD_PRELOAD=../../EasySandbox/EasySandbox.so ./a.out < $testin | grep -v "entering SECCOMP mode" &> test.out;
    if …
Run Code Online (Sandbox Code Playgroud)

bash scripts

6
推荐指数
1
解决办法
8851
查看次数

标签 统计

bash ×1

scripts ×1