Linux Bash对拍
2020-06-29 05:02
1271 查看
代码:
#!/bin/bash while true; do ./rand > input //数据生成器 ./test < input > output //测试程序 ./std < input > stdout //标程 if diff output stdout; then printf "Accepted\n" //正确 else printf "Wrong Answer\n" //错误 break fi sleep 0.2 //暂停0.2s done
步骤:
- 将代码存储为judge.sh
- 在终端运行 chmod +x judge.sh
- 在终端运行 ./judge.sh
转载于:https://www.cnblogs.com/Krew/p/6705922.html
相关文章推荐
- 关于linux报bash ‘/bin/sh: Syntax error: “(” unexpected
- sed—在linux 中执行脚本的时候出现: /bin/bash^M: bad interpreter: No such file or directory
- 鸟哥的 Linux 私房菜第11章-认识与学习 BASH 学习笔记
- Linux环境配置文件 /etc/profile ~/.bash_profile ~/.bashrc /etc/bashrc的区别
- Linux学习笔记——BASH
- 【Linux学习笔记】24:Bash变量概述
- 菜鸟学Linux 第014篇笔记 bash脚本(变量,变量类型)
- Linux学习总结(33)——Linux Java启动关闭bash脚本
- Linux下修改.bash_profile 文件改变PATH变量的值
- Linux之bash的特性
- Linux命令行报bash:.....:command not found的解决办法
- linux下使用shutdown命令关机,提示: -bash:shutdown:command not found
- linux常用bash命令介绍
- bash脚本实例-linux性能数据清洗-1
- Linux 系统启动文件,bash 启动文件,设置环境变量的位置
- linux 切换用户之后变成-bash-3.2$
- 【Linux基础学习之三】Bash的一些基础知识总结(通配符、重定向、管道、命令补全)
- Linux复习笔记(一) -- Bash的基本操作
- 02-linux_bash_shell
- linux grep egrep fgrep bash条件判断 bash测试 if 条件判断