views:

339

answers:

2
 export PATH=${/home/mohit/}:<android-sdk-linux_86>/tools

this is what i am using..

error:--

bash: PATH=${/home/mohit/}:: bad substitution

this is the path of sdk

mohit@mohit-laptop:~/android-sdk-linux_86$ pwd
/home/mohit/android-sdk-linux_86
+2  A: 

Typically you will use

export PATH=${PATH}:<added path here>

try that, to append to your $PATH variable, or just remove the ${} and set it directly, if you wish to replace it. Also keep in mind, this change is not permanent unless you add this to your .bashrc or .bash_profile or equivalent scripts. You can reload them with the

source .bash_profile

command without having to re-login.

Alex
@Alex can u tell me exact path.. I m not able to figure this out.
piemesons
export PATH="$PATH":"$HOME/mohit/android-sdk-linux_86/tools" Is this fine..
piemesons
export PATH=${PATH}:"~/mohit/android-sdk-linux_86/tools"
Alex
or you can use: export PATH=${PATH}:"${HOME}/mohit/android-sdk-linux_86/tools"make sure $HOME environment var is defined in your shell
Alex
@Alex, "$HOME" is the full path to the user's home directory... likewise "~" is the user's home directory... "/home/mohit/" is the home folder for the user name "mohit".
Michael Aaron Safyan
@Alex, also, I think you meant "source ~/.bash_profile" and not "script ~/.bash_profile".
Michael Aaron Safyan
You are right, I've fixed it. Thanks.
Alex
A: 

The problem is that ${/home/mohit/} is actually treating /home/mohit/ as a variable and attempting to dereference it. My guess is that what you really wanted to do was:

export PATH="$PATH":"$HOME/android-sdk-linux_86/tools"
Michael Aaron Safyan