.bash-profile

How to edit corrupted bash profile

霸气de小男生 提交于 2019-11-29 17:43:10
I exported a PATH that is incorrect in my bash profile, and I can no longer open it to edit it. Even worse, my terminal is basically completely broken because of this. If I run vim ~/.bash_profile I get the following errors: -bash: vim: command not found -bash: sed: command not found If I try to use a command like ls I get: -bash: ls: command not found -bash: sed: command not found How can I fix my bash profile if I can't even edit it? Your terminal isn't broken, bash is just lost because it is using this broken PATH variable, which you have saved in ~/.bash_profile. So, when you reload

.bash_profile sed: \1 not defined in the RE

白昼怎懂夜的黑 提交于 2019-11-28 18:32:27
问题 I've to set up a local web development environment on my OS X 10.9 and installed Homebrew. Next step in my guide tells me to add logic to my ~/.bash_profile with the following command: echo "export PATH=\$(echo \$PATH | sed 's|/usr/local/bin||; s|/usr/local/sbin||; s|::|:|; s|^:||; s|(.*)|/usr/local/bin:/usr/local/sbin:\1|')" >> ~/.bash_profile && source ~/.bash_profile When I enter it in the terminal I get: sed: 1: "s|/usr/local/bin||; s|/ ...": \1 not defined in the RE Is it export PATH=

Automatically defining GOPATH on a per project basis

泪湿孤枕 提交于 2019-11-28 16:01:22
问题 For every project I create I have to do export GOPATH={path_to_project} every time i cd into the project dir. There has to be an easier way. Isn't there some way I can create a .bashrc or .bash_profile file for a given directory to define the GOPATH for that project? For example, I have two go projects A and B. If I have a singular GOPATH that isn't redefined when I move between projects then binaries for both projects will be stored in the same place. More importantly, binaries for third

sudo: port: command not found

别等时光非礼了梦想. 提交于 2019-11-28 15:28:52
问题 I recently uninstalled Xcode 4.2 and re-installed Xcode 4.3.1. Command Line Tools are installed. I then installed MacPort using “dmg” disk images for Lion from macports.org. Since, I was getting sudo: port: command not found after every use of port, I followed this and this post to create a .bash_profile file(wasn't present earlier) and then put in it the following but to no avail. export PATH=$PATH:/opt/local/bin export MANPATH=$MANPATH:/opt/local/share/man export INFOPATH=$INFOPATH:/opt

Passing argument to alias in bash [duplicate]

醉酒当歌 提交于 2019-11-28 15:26:42
This question already has an answer here: Make a Bash alias that takes a parameter? 13 answers Is it possible to do the following: I want to run the following: mongodb bin/mongod In my bash_profile I have alias = "./path/to/mongodb/$1" An alias will expand to the string it represents. Anything after the alias will appear after its expansion without needing to be or able to be passed as explicit arguments (e.g. $1 ). $ alias foo='/path/to/bar' $ foo some args will get expanded to $ /path/to/bar some args If you want to use explicit arguments, you'll need to use a function $ foo () { /path/to

.bash_profile corrupted not found, command not found… Help restore it back to the original [duplicate]

社会主义新天地 提交于 2019-11-28 11:15:22
问题 This question already has an answer here : How to restore .bash_profile on a mac? None of my unix terminal are working [closed] (1 answer) Closed 3 months ago . I was playing with the installation of Mongo db on my mac... and in exporting the Mongodb/bin dir to PATH .. looks like I corrupted the bash_profile and now I can't find it.. This is what I did : nano ~/.bash_profile The file did not exist, so I went ahead created one and added the following line export PATH={$PATH}:~/mongo/bin So now

Getting “Warning! PATH is not properly set up” when doing rvm use 2.0.0 --default

女生的网名这么多〃 提交于 2019-11-27 10:05:45
Above doesn't work first time, works 2nd time. Try to set ruby version to 2.0.0 for any new shell windows. Doing $ rvm use 2.0.0 --default gives Warning! PATH is not properly set up, '/home/durrantm/.rvm/gems/ruby-1.9.3-p125/ bin' is not at first place, usually this is caused by shell initialization files - check them for ' PATH=...' entries, it might also help to re-add RVM to your dotfiles: 'rvm get stable --au to-dotfiles', to fix temporarily in this shell session run: 'rvm use ruby-1.9.3-p125' . Using /home/durrantm/.rvm/gems/ruby-2.0.0-p247 Then doing the same $ rvm use 2.0.0 --default

Passing argument to alias in bash [duplicate]

只愿长相守 提交于 2019-11-27 09:12:27
问题 This question already has an answer here: Make a Bash alias that takes a parameter? 13 answers Is it possible to do the following: I want to run the following: mongodb bin/mongod In my bash_profile I have alias = "./path/to/mongodb/$1" 回答1: An alias will expand to the string it represents. Anything after the alias will appear after its expansion without needing to be or able to be passed as explicit arguments (e.g. $1 ). $ alias foo='/path/to/bar' $ foo some args will get expanded to $ /path

Difference between .profile and .bash_profile on Snow Leopard

一曲冷凌霜 提交于 2019-11-27 06:26:42
I am going to set the path for mySQl on my computer (I'm running Snow Leopard) but I see different instructions online. Some say to change the .profile file and some say to change the .bash_profile file. What is the difference? .profile works with sh or bash . However .bash_profile is bash-specific and will override .profile if present. hlim I believe mac OS X environment checks .bash_profile , .bash_login , .profile in this order. It will run whichever is the highest in the hierarchy, so, if you have .bash_profile , it will not check .profile . 来源: https://stackoverflow.com/questions/6751252

.bash_profile syntax error: unexpected end of file

笑着哭i 提交于 2019-11-27 04:51:35
问题 OS: macOS Sierra v10.12.2 I was trying to get R working from the command line and ran into this problem, probably because I am relatively new to coding and messed with something I should not have. Upon opening new terminal: -bash: /Users/Brad/.bash_profile: line 33: syntax error: unexpected end of file When I inspect the profile it looks like this: # Setting PATH for Python 2.7 # The orginal version is saved in .bash_profile.pysave PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:$