Running C code in Redhat 7.2
Hi,
I'm new to this forum and a unix newbee. You'll probably see lots of posts from me comming up for the next few months. I had to install unix because I'm doing C programming for unix. I started with something simple, a hello world C program, which I saved as hello.c I then compiled as gcc hello.c -o hello This makes an executable binary file in the same dir. But how do I run it? If I just type 'hello' and press enter it says 'command not found'. I also tried running it through the GNOME interface but nothing happens. I'm using Redhat 7.2 with GNOME. |
For security reasons the current directory is not normally in your PATH on most Linux setups. To run a program in the current directory, do this:
./hello |
Thanks mhearn. That did the trick.
|
All times are GMT -5. The time now is 04:35 PM. |