cc (296B)
1 #!/bin/sh 2 c_file="" 3 has_o="" 4 has_c="" 5 6 for arg; do 7 case "$arg" in 8 -o) has_o=1 ;; 9 -c) has_c=1 ;; 10 *.c) c_file="$arg" ;; 11 esac 12 done 13 14 if [ -n "$c_file" ] && [ -z "$has_o" ]; then 15 [ -z "$has_c" ] && set -- -c "$@" 16 exec /usr/bin/cc "$@" -o "${c_file%.c}.o" 17 fi 18 19 exec /usr/bin/cc "$@"