LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ./main to main (https://www.linuxquestions.org/questions/linux-newbie-8/main-to-main-346648/)

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?

Thanks.

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:
Code:

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.