Obviously that doesn’t scale, but for a beginner it’s simple.
$ ls $ cat >a.c <<EOF int main(){return 42;} EOF $ make a cc a.c -o a $ ./a; echo $? 42 $
$ echo 'int main(){return 42;}' > a.c; make a && ./a; echo $?