3

I wanted to be able to run program from anywhere without adding ./, so I edited ~/.bashrc to contain this line

export PATH=$PATH:.

Now when I type echo $PATH I get

[......]:/home/yotam/omnetpp-4.2.2/bin:.: No such file or directory

Why is that? Also, I'm not sure about why using export, I get the same result if I just type PATH=$PATH:more_valuew without export. So what's the difference?

Thanks!

1 Answer 1

1

Only the command contained to the directory described to the environment variable PATH can perform without ./ .

In this case, if you want to add current directory in PATH,

Replace to this:

export PATH=$PATH:./:

In General :

To make a temporary change the value of an environment variable enter the command:

VARNAME=value_of_variable

This value will remain until you exit from the shell you are working in.

To make other programs that use the variable aware of the new value enter the command:

export VARNAME
2
  • Oh well the omnetpp is no really related to the issue, my bed. I just want to be able to run programs from anywhere so I want ./ to be in my PATH
    – Yotam
    Aug 16, 2012 at 9:07
  • OK, I rewrote the above description.
    – vine_user
    Aug 16, 2012 at 9:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .