2

I was working on amending my ANDROID_HOME and PATH to begin working with Cordova for mobile application development. I was having trouble with export $PATH returning a not a valid identifier error. I changed a $PATH reference in a line in the .bash_profile to PATH on recommendation and now I'm entirely unable to open .bash_profile. I am using Mac OS X Yosemite. I receive the following error:

-bash: open: command not found

From research, it's likely a typo in the .bash_profile but I'm unaware of how I can rectify this without being able to open the .bash_profile itself, can anybody help? Also when attempting to call Cordova e.g. cordova add platform android I receive -bash: cordova: command not found after it previously functioned correctly?

My .bash_profile included export ANDROID_HOME=/Development/android-sdk-macosx export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

I believe I mistakenly removed $ from the 2nd line, leaving PATH={PATH}.

As I am using Mac OS X all dot files are hidden, when attempting to show . files I receive the error -bash: defaults: command not found.

Thanks

nlw13
  • 95
  • 1
  • 2
  • 10

2 Answers2

1

export $PATH doesn't do what you expect - variable substitution happens before command execution in Bash. You need to export PATH. And to debug the contents of any dot files you need to include their contents in the question.

l0b0
  • 55,365
  • 30
  • 138
  • 223
  • Thank you for the response. My apologies, I'm still learning the ropes here! The contents were: `export ANDROID_HOME=/Development/android-sdk-macosx export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools` I believe I mistakenly removed $ from the 2nd line, leaving PATH={PATH}. – nlw13 Nov 24 '14 at 21:47
  • Thank you. I have done this. – nlw13 Nov 25 '14 at 10:59
0

Having destroyed your PATH environment variable your shell can no longer find any binaries. You can either give a full path to whatever application you want to run to edit your .bash_profile file or just open it from your chosen editor using the gui file selector.

Etan Reisner
  • 77,877
  • 8
  • 106
  • 148
  • 1
    Thank you. I neglected to mention I am using Mac OS X so all . files are hidden. When attempting to show . files I receive the error `-bash: defaults: command not found`. Can you recommend another way to access and edit the `.bash_profile`? – nlw13 Nov 25 '14 at 11:03