3 ms·
Compiler errors won’t cause as many funny consequences with gcc "$0" -o "$@".out && exec ./"$@".out || exit $? # I'd use ${0%.c} not $@ Love this trick to
by mananaysiempre 1y ago
Compiler errors won’t cause as many funny consequences with
gcc "$0" -o "$@".out && exec ./"$@".out || exit $? # I'd use ${0%.c} not $@
Love this trick too, but the difference, as far as I understand, is that it only works with a Bourne(-compatible) shell, whereas shebangs or binfmt_misc also work with exec().