Compare commits

..

4 Commits

Author SHA1 Message Date
Brian Seymour 6615ec4519
Merge pull request #66 from Vrganj/run-java-directly
Run Java directly to avoid grep
2021-02-03 21:48:12 -06:00
Brian Seymour 178ddf19d6
Merge pull request #67 from TitouanT/c_args
fixed c args and added node lockfile to .gitignore
2021-02-03 21:47:46 -06:00
TitouanT e169d0cab8 fixed c args and added node lockfile to .gitignore 2021-02-01 01:21:20 +01:00
Vrganj ab8ede1c5d Run Java directly to avoid grep 2021-01-31 18:24:11 +01:00
3 changed files with 6 additions and 7 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
api/api api/api
api/package-lock.json
lxc/i lxc/i
lxc/lockfile lxc/lockfile

View File

@ -1,5 +1,5 @@
#!/usr/bin/bash #!/usr/bin/bash
cd /tmp/$2 cd /tmp/$2
gcc -std=c11 -o binary -x c code.code timeout -s KILL 10 gcc -std=c11 -o binary -x c code.code
timeout -s KILL 3 xargs -a args.args ./binary < stdin.stdin timeout -s KILL 3 xargs -a args.args -d '\n' ./binary < stdin.stdin

View File

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