Mercurial > repo
annotate lib/interp @ 12227:9cb638b68832 draft
<oerjan> t sled lib/interp//6iecho $ARGFILE
author | HackEso <hackeso@esolangs.org> |
---|---|
date | Wed, 04 Dec 2019 04:28:21 +0000 |
parents | 7b17fe055014 |
children | 6cb5704166cb |
rev | line source |
---|---|
996 | 1 #!/bin/sh |
2 | |
3 export I_CMD="$0" | |
4 export I_ARG="$1" | |
5 export ARG_FILE="/tmp/input.$$" | |
12227
9cb638b68832
<oerjan> t sled lib/interp//6iecho $ARGFILE
HackEso <hackeso@esolangs.org>
parents:
4930
diff
changeset
|
6 echo $ARGFILE |
996 | 7 |
8 get_arg() { | |
9 #if expr "$I_ARG" : "http://" > /dev/null | |
10 #then | |
11 # wget $WGET_OPTIONS "$I_ARG" -O "$ARG_FILE" | |
12 #else | |
4930 | 13 printf '%s' "$I_ARG" > "$ARG_FILE" |
996 | 14 #fi |
15 } | |
16 | |
17 clean_arg() { | |
18 rm -f "$ARG_FILE" | |
19 } | |
20 | |
21 interp_stdin() { | |
22 get_arg | |
23 $1 < "$ARG_FILE" 2>&1 | |
24 clean_arg | |
25 } | |
26 | |
27 interp_file() { | |
28 get_arg | |
29 $1 "$ARG_FILE" 2>&1 | |
30 clean_arg | |
31 } | |
32 | |
33 interp_stdin_java() { | |
34 get_arg | |
35 cd $1 | |
36 java $2 < "$ARG_FILE" 2>&1 | |
37 clean_arg | |
38 } | |
39 | |
40 interp_file_java() { | |
41 get_arg | |
42 cd $1 | |
43 java $2 "$ARG_FILE" 2>&1 | |
44 clean_arg | |
45 } |