When running scripts in bash, I have to write ./
in the beginning:
$ ./manage.py syncdb
If I don\'t, I get an error message:>
When bash interprets the command line, it looks for commands in locations described in the environment variable $PATH
. To see it type:
echo $PATH
You will have some paths separated by colons. As you will see the current path .
is usually not in $PATH
. So Bash cannot find your command if it is in the current directory. You can change it by having:
PATH=$PATH:.
This line adds the current directory in $PATH
so you can do:
manage.py syncdb
It is not recommended as it has security issue, plus you can have weird behaviours, as .
varies upon the directory you are in :)
Avoid:
PATH=.:$PATH
As you can “mask” some standard command and open the door to security breach :)
Just my two cents.