I really want to sleep right now, so if you see me wondering off the track - I warned you.
(5 minutes later...)
I have started a script for compiling my C programs. I want to find out how I can name the output file from gcc the same thing only without the .c suffix (e.g. I have source file "code.c" and I want executable called "code").
Below is the code I got. I know it is wrong (as it does not work
Also, "crp" is my own program that produces a trimmed string output (in the code below, I leave all the prefix, but delete 2 characters from the suffix (.c))
case $# in
"1") crp $1 0 2 | gcc -Wall -ansi -pedantic $1 -o ;
"2") gcc -Wall -ansi -pedantic $1 -o $2 ;;
*) echo "USAGE: $0 filename | filename <filename>"