Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

macfreek57

macrumors 6502
Original poster
Jan 1, 2002
379
0
Baton Rouge, Louisiana
i'm using command line gcc
i forgot how to execute the "a.out" files in the terminal because i've been doing most of my programming on windows computers at school :rolleyes:
i know it's simple but could someone help me out?
 
Normally you'd have gcc output a file called something other than a.out using the -o switch:

gcc -o my_great_program <all the files you need>

Then to run it you would type ./my_great_program

If you don't want to type the ./ every time (and don't mind a little risk) you can add the ./ to your PATH environment variable.
 
I thought it might be the ./ (which is simply the current directory).

Unix looks through your PATH for programs when you type a name into the terminal. Normally you have things like /usr/bin in your path. You can add ./ to it, but be careful as you try and run anything in your current dir.

You would normally do this in your ~/.profile file. If you add the following line to your .profile then ./ will be in your path (tested in Panther, should work in Jaguar)

PATH=./:${PATH}

Hope that helps!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.