Run Java directly to avoid grep

This commit is contained in:
Vrganj 2021-01-31 18:24:11 +01:00
parent 0f8350b6da
commit ab8ede1c5d
1 changed files with 3 additions and 5 deletions

View File

@ -1,7 +1,5 @@
#!/bin/bash
cd /tmp/$2
name=$(grep -Po "(?<=\n|\A)\s*(public\s+)?(class|interface)\s+\K([^\/\\\\\n\s{]+)" code.code)
cp code.code $name.java
javac $name.java
timeout -s KILL 3 xargs -a args.args -d '\n' java $name < stdin.stdin
cp code.code interim.java
timeout -s KILL 10 xargs -a args.args -d '\n' java interim.java < stdin.stdin