diff options
| author | tslil clingman <> | 2021-07-14 18:26:32 -0400 |
|---|---|---|
| committer | tslil clingman <> | 2021-07-14 18:26:32 -0400 |
| commit | 5b4fb66bebc154a8fd121edae6b2e44ee71566bd (patch) | |
| tree | e077633812762661fb29e84b6c84773a52c39c62 /ci | |
| parent | 9569368eb6cf50eba21341766487f865723ee669 (diff) | |
| parent | 3c79bbc4529f62d462f6807f354b6b4c5e3477e6 (diff) | |
Merge branch 'master' of git.sr.ht:~tslil/scripts
Diffstat (limited to 'ci')
| -rwxr-xr-x | ci | 26 |
1 files changed, 13 insertions, 13 deletions
@@ -1,32 +1,32 @@ #!/usr/bin/env sh # Convenient frontend for quickly evaluating C code -LIBR="stdlib stdio math ieee754 limits stdint" +LIBR="stdlib stdio math ieee754 limits stdint stdstring" FLAG="-Wall -lm" -NAME=/tmp/$RANDOM-$RANDOM +gen_rand() { + od -A n -t d -N 1 /dev/urandom | tr -d ' ' +} + +NAME=/tmp/$(gen_rand)-$(gen_rand) SRC=$NAME.c BIN=$NAME-B -for k in $LIBR; do - echo "#include<$k.h>" >> $SRC +for k in $LIBR; do + echo "#include<$k.h>" >> $SRC done -#echo -e "int main(int argc, char ** argv) {\n\n return 0;\n}" >> $SRC -#zile +8 $SRC - echo "int main(int argc, char ** argv) {" >> $SRC rlwrap -o cat >> $SRC echo "return 0;}" >> $SRC - -echo -e "\n\n\t!!! Compiling ..." -gcc $FLAG $SRC -o $BIN +printf "\n\n\t!!! Compiling ..." +cc $FLAG $SRC -o $BIN if [ "$?" = "0" ]; then - echo -e "\t!!! Executing ...\n\n" - exec $BIN - rm $BIN + printf "\n\n\t!!! Executing ...\n\n" + exec $BIN + rm $BIN fi; rm $SRC |
