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

s1587

macrumors newbie
Original poster
Hi i am new to Mac so please help me out. I have to run a Linux shell using the terminal. My shell has been coded using C. I have gcc installed but bash refuses to recognize the command. I must run the program on the terminal only. Can someone please help me out here.
 
Hi i am new to Mac so please help me out. I have to run a Linux shell using the terminal. My shell has been coded using C. I have gcc installed but bash refuses to recognize the command. I must run the program on the terminal only. Can someone please help me out here.

screenshots please
 
So you wrote a program in "C"... did you compile it?

Sounds like you successfully started Terminal, if you have a .app,

./myApplication.app

should run it...

if you didn't compile yet,

gcc myApplication.c -o myApplication.app

then try and run it
 
i have installed xcode as well. once i type gcc prog.c i get a message "-bash: gcc: command not found".
 
i have installed xcode as well. once i type gcc prog.c i get a message "-bash: gcc: command not found".

If you installed Xcode with the current Terminal session running you may just need to quit and relaunch the Terminal application for it to use the updated path information.
 
Is there any specific path where the gcc folder must be stored for bash to recognize it?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.