LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Edited bashrc not sure how to fix (https://www.linuxquestions.org/questions/linux-newbie-8/edited-bashrc-not-sure-how-to-fix-4175442529/)

wangcow 12-22-2012 12:59 AM

Edited bashrc not sure how to fix
 
Hello I've been using linux a few months now and everythings been going great. Im on Mint 14 w/ Cinnamon 64-bit.

Well I was recently following this guide:
Code:

http://forum.xda-developers.com/showthread.php?t=1550414
to get adb on this distro.

Well at step 7 I alterd the line
Code:

# Android tools
export PATH=~/android-sdk-linux/platform-tools:~/android-sdk-linux/tools:$PATH

to
Code:

# Android tools
export PATH=~/Documents/Android Dev/sdk/platform-tools:~/Documents/Android Dev/sdk/platform-tools:$PATH

and now I get this error and out put whenever opening terminal:
Code:

bash: export: `Dev/sdk/platform-tools:~/Documents/Android': not a valid identifier
bash: export: `Dev/sdk/platform-tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games': not a valid identifier
jmartino@jmartino-A15 ~ $ sudo gedit ~/.bashrc
Traceback (most recent call last):
  File "/usr/lib/command-not-found", line 21, in <module>
    os.execvp("python3", [sys.argv[0]] + sys.argv)
  File "/usr/lib/python2.7/os.py", line 344, in execvp
    _execvpe(file, args)
  File "/usr/lib/python2.7/os.py", line 380, in _execvpe
    func(fullname, *argrest)
OSError: [Errno 2] No such file or directory

This is my first time posting in forever so I hope my post is clear.. thanks alot for any help.

markush 12-22-2012 02:31 AM

Code:

# Android tools
export PATH=~/Documents/Android Dev/sdk/platform-tools:~/Documents/Android Dev/sdk/platform-tools:$PATH

The spaces in the path are not correct. If there's really a space you'll have to quote the path within ""

Markus

David the H. 12-22-2012 07:05 AM

As markush said, it's the spaces. The right side of a "varname=value" setting command can only consist of a single "word" (more accurately, a "token"), as deliminated by whitespace. Quoting the string forces the shell to ignore the spaces and see it as a single unit.

This is one specific instance of the shell's argument processing and word-splitting behavior, the understanding of which is vital for scripting and shell use.

Study these links well:

http://mywiki.wooledge.org/Arguments
http://mywiki.wooledge.org/WordSplitting
http://mywiki.wooledge.org/Quotes


Even better, if at all possible, is to just not have spaces in file and path names in the first place. ;)


Also note, BTW, that "~" is an alias designed mostly for interactive use. It's usually recommended to use the built-in "$HOME" variable instead for scripted commands.

Code:

export PATH="$HOME/Documents/Android Dev/sdk/platform-tools:$HOME/Documents/Android Dev/sdk/platform-tools:$PATH"

wangcow 12-22-2012 04:28 PM

Thank you so much that fixed it.

Thanks for the links too, Ill be reading those soon.


All times are GMT -5. The time now is 08:30 PM.