やり方
.bash_profileに以下を記入
function shellc () { gcc $1 -o ~/.out && ~/.out }
試す
test.cを作成
#include <stdio.h> int main(void) { printf("Hello World!\n"); return 0; }
bash上で実行
USER$ shellc test.c Hello World!
function shellc () { gcc $1 -o ~/.out && ~/.out }
#include <stdio.h> int main(void) { printf("Hello World!\n"); return 0; }
USER$ shellc test.c Hello World!