0
 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
Mohit Jain
  • 43,139
  • 57
  • 169
  • 274

4 Answers4

6

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
  • 3,644
  • 2
  • 19
  • 27
1

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
  • 93,612
  • 16
  • 138
  • 200
0

You can edit your /etc/profile to add the path you need. Like this:

JAVA_HOME=/opt/jdk1.6.0_30
CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export JAVA_HOME
export CLASSPATH
PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin

It is global.

twlkyao
  • 14,302
  • 7
  • 27
  • 44
0

You can maintain a script file under /etc/profile.d/ and we can use it as global

Arivazhagan L
  • 39
  • 1
  • 13