compile a directory & run

files="" && ls -1 *.c|while read line; do files="$line $files"; done && $(gcc -Wall $(echo $files) -o bin.x) && echo -ne "Running bin.x\n" && ./bin.x > bin.log &

zsh saves variables. bash doesn’t.

files="" && ls -1 *.c|while read line; do files="$files $line"; echo $files > files.lst; done && gcc -v -Wall `tail -n 1 files.lst` -o bin.x && echo -ne "Running bin.x\n" && ./bin.x

Published by moon_man

34 y.o. human from the Moon

Leave a comment

Your email address will not be published. Required fields are marked *