Environment variable not getting updated

I added the following lines to my .bashrc

$PATH = "/home/ravi/bin/CodeSourcery/Sourcery_G++_Lite/bin/:$PATH"
export PATH

But the path is not getting appended.Moreover, i get the following output:

bash: /usr/bin:/home/ravi/bin:/usr/local/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/usr/lib/qt3/bin: No such file or directory

But i checked that all the directories do exist.Any clues?

You should use
PATH=something

$PATH=something
is not correct.

But PATH=something throws the following error:
bash: PATH: command not found

No spaces around the =

$PATH = “/home/ravi/bin/CodeSourcery/Sourcery_G++_Lite/bin/:$PATH”
export PATH
should be:
PATH = “/home/ravi/bin/CodeSourcery/Sourcery_G++_Lite/bin/:$PATH”
export PATH
or better yet
export PATH = /home/ravi/bin/CodeSourcery/Sourcery_G++_Lite/bin/:$PATH
the “No such file or directory” from the way you did it originally makes sense to old unix weenies, the “$” denotes the value of the variable. In essence, simply typing “$PATH” in a konsole is the equivalent of typing the whole value of your path and hitting enter.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Exactly, and to wrap it up you can combine those commands into one with
bash:

export PATH="/home/ravi/bin/CodeSourcery/Sourcery_G++_Lite/bin/:$PATH"

Good luck.

dgholstein wrote:
>> $PATH = “/home/ravi/bin/CodeSourcery/Sourcery_G++_Lite/bin/:$PATH”
>> export PATHshould be:> PATH = “/home/ravi/bin/CodeSourcery/Sourcery_G++_Lite/bin/:$PATH”
>> export PATHor better yet> export PATH = /home/ravi/bin/CodeSourcery/Sourcery_G++_Lite/bin/:$PATHthe “-No such file or directory-” from the way you did it originally
> makes sense to old unix weenies, the “$” denotes the value of the
> variable. In essence, simply typing “$PATH” in a konsole is the
> equivalent of typing the whole value of your path and hitting enter.
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJls4v3s42bA80+9kRAp0tAJ0ba+bn7pJfFkdG1/0xDMylEx7miACfQA68
zF/+3y4sQIaE4BI0ztE0k3M=
=iBiM
-----END PGP SIGNATURE-----

Thanks all

export PATH="/home/ravi/bin/CodeSourcery/Sourcery_G++_Lite/bin/:$PATH"

worked like a charm lol!

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Good to hear. Thank-you for posting back your results.

Good luck.

thisisravi wrote:
> Thanks all
>
> Code:
> --------------------
> export PATH="/home/ravi/bin/CodeSourcery/Sourcery_G++_Lite/bin/:$PATH"
> --------------------
>
>
> worked like a charm lol!
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJlvpz3s42bA80+9kRAvKiAJ9Dt0Z/JVhb+TD7rra+wzyYAjVB8wCePE8p
7Gr80ILlOJxu+vGMIUNmUSA=
=xuqi
-----END PGP SIGNATURE-----