LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   want to type <exename> instead of ./<exename> (https://www.linuxquestions.org/questions/linux-newbie-8/want-to-type-exename-instead-of-exename-281875/)

zchoyt 01-24-2005 11:57 PM

want to type <exename> instead of ./<exename>
 
I somehow got my FC2 box to behave this way, but I don't remember how. Does anyone know? I have a FC3 box now and I have to always type ./ in front of the exe name.

scuzzman 01-24-2005 11:58 PM

While this is a security risk, the solution is to add . to your $PATH. You can do so with this command:
Code:

export PATH "$PATH:."

zchoyt 02-02-2005 09:48 PM

What would the exact syntax be to add this to the .bash_profile file?

Here is what I have tried:
PATH=$PATH:$HOME/bin:.
PATH=$PATH:$HOME/bin:"."
PATH=$PATH:$HOME/bin:'.'


When I go to source the file, I keep getting "not a valid identifier":
............/root/bin:/root/bin:.': not a valid identifier


I obviously have the syntax wrong.

Please help

beaucoup 02-02-2005 10:02 PM

try

PATH="$PATH:$HOME/bin:."

IBall 02-03-2005 12:05 AM

You have to export the PATH variable to the Shell. In your .bash_profile

Code:

export PATH=$PATH:$HOME/bin:.
Quote:

When I go to source the file, I keep getting "not a valid identifier":
............/root/bin:/root/bin:.': not a valid identifier
Don't do this for the root user. It is a security risk. Only add the current directory to the path for non-root users.

I hope this helps
--Ian

zchoyt 02-03-2005 03:41 AM

Ok, I was beeing hasty. I didn't include the export keyword. Thanks

acid_kewpie 02-03-2005 06:57 AM

oh please don't do this, it's really really nasty.

it doesn't make any sense to be able to run a command from one driectory, and not from another. please stick to standards, they are there for a VERY good reason.


All times are GMT -5. The time now is 05:47 PM.