Fedora Linux Support Community & Resources Center
  #1  
Old 15th September 2005, 06:45 AM
kqyym Offline
Registered User
 
Join Date: Jul 2005
Posts: 19
How to run executable file in current directory without adding ./?

I just installed FC4.
Every time when I try to run some .ex file in current directory, I need to add ./ in front of the filename. I know there's some way to fix this problem but I just forget.
Thanks in advance!
__________________
We love because God love first! :)
Reply With Quote
  #2  
Old 15th September 2005, 06:51 AM
smfinley Offline
Retired Community Manager
 
Join Date: Jul 2004
Posts: 1,334
Usually "sh <filename>".
__________________
Stanton Finley
stanton-finley.net
Reply With Quote
  #3  
Old 15th September 2005, 07:29 AM
kqyym Offline
Registered User
 
Join Date: Jul 2005
Posts: 19
Quote:
Originally Posted by smfinley
Usually "sh <filename>".
I don't understand.
To make my question clear, let me take an example.
I have try.ex file in my current directory.
If I type try.ex, it can't find this file but I type ./try.ex, it will work.
My question is what's the way to solve this problem permenantly by adding something to some system file, which will be loaded automatically when start.
I know there is some way to do this because I saw somebody did this.
Thanks!
__________________
We love because God love first! :)
Reply With Quote
  #4  
Old 15th September 2005, 07:32 AM
Spoon! Offline
Registered User
 
Join Date: Aug 2005
Location: Hell
Posts: 758
You need to add "." to your $PATH
Reply With Quote
  #5  
Old 15th September 2005, 07:40 AM
kqyym Offline
Registered User
 
Join Date: Jul 2005
Posts: 19
Quote:
Originally Posted by Spoon!
You need to add "." to your $PATH
One stupid question.
How to add "." to my $PATH? Thanks a lot!
__________________
We love because God love first! :)
Reply With Quote
  #6  
Old 15th September 2005, 07:57 AM
Spoon! Offline
Registered User
 
Join Date: Aug 2005
Location: Hell
Posts: 758
In your ~/.bash_profile (for your user) or in your /etc/bash_profile (for the whole system), add these lines if they don't already exist:
Code:
PATH=$PATH:.
export PATH
(If there is already something being added to PATH in there, e.g. "PATH=$PATH:foo", just add to the end of it, like "PATH=$PATH:foo:.")

And then just logout and log back in, or just do "source ~/.bash_profile" or something like that to see the changes.

Last edited by Spoon!; 15th September 2005 at 08:00 AM.
Reply With Quote
  #7  
Old 15th September 2005, 04:32 PM
tejas Offline
Registered User
 
Join Date: Feb 2005
Location: Bangalore
Age: 27
Posts: 1,574
your path line will look like this:

PATH=$PATH:$HOME/bin

change it to this:
PATH=$PATH:$HOME/bin:.
__________________
I Was Counted! Registered Linux User #384707

BASH && Beer && Bass! Now THAT makes sense!!
Reply With Quote
  #8  
Old 15th September 2005, 05:06 PM
sej7278 Offline
Registered User
 
Join Date: Sep 2004
Posts: 2,008
and make sure it's executable:

chmod a+x program.exe
Reply With Quote
  #9  
Old 16th September 2005, 10:51 PM
kqyym Offline
Registered User
 
Join Date: Jul 2005
Posts: 19
It solve the problem.
Thanks a lot to all!
__________________
We love because God love first! :)
Reply With Quote
  #10  
Old 16th September 2005, 11:30 PM
sucafish Offline
Registered User
 
Join Date: May 2005
Posts: 35
Do you know how many executables in you could have run by not asking that question?

./ only takes two.

he he he
Reply With Quote
  #11  
Old 19th September 2005, 03:11 AM
kqyym Offline
Registered User
 
Join Date: Jul 2005
Posts: 19
I don't quite understand your question. You want to run them simultaneously or what?
__________________
We love because God love first! :)
Reply With Quote
Reply

Tags
adding, current, directory, executable, file, run

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Start a new bash whose current directory is changed fmoreau Using Fedora 7 23rd January 2008 10:35 PM
Adding SATA to Current ATA Machine Flyboy917 Using Fedora 0 13th December 2005 04:49 AM
Current directory in terminal plus one foxhound4 Using Fedora 3 10th October 2004 06:50 AM
Executable File! Dreamy Programming & Packaging 7 11th September 2004 03:35 PM


Current GMT-time: 14:23 (Thursday, 27-11-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat
Forbes Field Wall Travel Photos on Instagram - Montmorency Water Falls Photos on Instagram - Pueblito Boyacence Photos on Instagram