Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 07-25-2005, 02:55 PM   #1
LQ Newbie
Registered: Dec 2004
Location: CA
Distribution: Red Hat 9.0
Posts: 13

Rep: Reputation: 0
./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?

Old 07-25-2005, 02:58 PM   #2
LQ Addict
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
You need to add . (ie. the current directory) to your $PATH.

Edit: sorry, Matir is right.

Last edited by Nylex; 07-25-2005 at 03:13 PM.
Old 07-25-2005, 03:02 PM   #3
LQ Guru
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 128Reputation: 128
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.
Old 07-25-2005, 03:09 PM   #4
LQ Newbie
Registered: Dec 2004
Location: CA
Distribution: Red Hat 9.0
Posts: 13

Original Poster
Rep: Reputation: 0
I love this forum!!! I just typed it in and I got two responses with solution within minutes!!!!

Thanks guys, it works.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Greetings from Main g_trueblood Member Intro 1 09-15-2005 01:20 PM
(2) Main Menu's? Isn't it, "there can be only one?" for the term "Main"? t3gah LQ Suggestions & Feedback 1 04-09-2005 09:30 AM
main() confusioning in C name_in_use450 Programming 6 07-27-2004 11:27 PM
more main()? linuxanswer Programming 3 10-26-2003 03:06 PM
help with gruger Linux - Software 3 06-20-2003 06:43 PM > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration