-   Linux - Newbie (
-   -   ./main to main (

DDD26 07-25-2005 02:55 PM

./main to main
Under Red Hat I need to type ./main to execute the code, whereas it is just "main" under Silicon Graphics. I thought the difference was from different shells. Is it possible to do something so that I can start the execution by typing "main" without "./" in front?


Nylex 07-25-2005 02:58 PM

You need to add . (ie. the current directory) to your $PATH.

Edit: sorry, Matir is right.

Matir 07-25-2005 03:02 PM

under bash, you would need:

export PATH=$PATH:.
This has many security implications, particularly on multiuser systems, but those can largely be mitigated by placing it at the END of the path.

DDD26 07-25-2005 03:09 PM

I love this forum!!! I just typed it in and I got two responses with solution within minutes!!!!

Thanks guys, it works.

All times are GMT -5. The time now is 02:49 PM.