File tree Expand file tree Collapse file tree 2 files changed +28
-28
lines changed
Expand file tree Collapse file tree 2 files changed +28
-28
lines changed Original file line number Diff line number Diff line change 1- #! /bin/bash
2-
3- # BASE_DIR - base directory for the untrusty scripts
4- # SRC_FILE - BASE_DUR plus the name of the text file where the source code resides
5- # BIN_FILE - BASE_DUR plus the name of the file that will execute the program resides
6- # INPUT_FILE - BASE_DUR plus the name of the file that will be used as input for the program
7-
8- javac " ${SRC_FILE} "
1+ #! /bin/bash
2+
3+ # BASE_DIR - base directory for the untrusty scripts
4+ # SRC_FILE - BASE_DUR plus the name of the text file where the source code resides
5+ # BIN_FILE - BASE_DUR plus the name of the file that will execute the program resides
6+ # INPUT_FILE - BASE_DUR plus the name of the file that will be used as input for the program
7+
8+ javac " ${SRC_FILE} "
Original file line number Diff line number Diff line change 1- #! /bin/bash
2-
3- # BASE_DIR - base directory for the untrusty scripts
4- # SRC_FILE - BASE_DUR plus the name of the text file where the source code resides
5- # BIN_FILE - BASE_DUR plus the name of the file that will execute the program resides
6- # INPUT_FILE - BASE_DUR plus the name of the file that will be used as input for the program
7-
8- cd " ${BASE_DIR} "
9-
10- for classfile in * .class; do
11- classname=${classfile% .* }
12-
13- if javap -public ${classname} | fgrep -q " public static void main(" ; then
14- if [ -n " ${INPUT_FILE} " ]; then
15- java ${classname} " $@ " < " ${INPUT_FILE} "
16- else
17- java ${classname} " $@ "
18- fi
19- fi
20- done
1+ #! /bin/bash
2+
3+ # BASE_DIR - base directory for the untrusty scripts
4+ # SRC_FILE - BASE_DUR plus the name of the text file where the source code resides
5+ # BIN_FILE - BASE_DUR plus the name of the file that will execute the program resides
6+ # INPUT_FILE - BASE_DUR plus the name of the file that will be used as input for the program
7+
8+ cd " ${BASE_DIR} "
9+
10+ for classfile in * .class; do
11+ classname=${classfile% .* }
12+
13+ if javap -public ${classname} | fgrep -q " public static void main(" ; then
14+ if [ -n " ${INPUT_FILE} " ]; then
15+ java ${classname} " $@ " < " ${INPUT_FILE} "
16+ else
17+ java ${classname} " $@ "
18+ fi
19+ fi
20+ done
You can’t perform that action at this time.
0 commit comments