.bash-profile

How to deactivate bash_history stats print when opening a new terminal window on my mac?

有些话、适合烂在心里 提交于 2019-12-21 21:39:14
问题 I just reinstalled MacOS (OSX 10.12) and as I'm redoing my IDEs and such I get this strange bash_history stats object that prints to every new terminal window! It's driving me bonkers, and after looking through all the preferences an settings I can't seem to turn it off! Does anyone know why this is suddenly happening? Is it something to do with iCloud Profile Syncing? Here's s picture below. Thanks so much for your help! Screenshot of bash terminal history stats Last login: Wed Jul 5 03:23

sudo open -e ~/.bash_profile Permission denied mac

孤者浪人 提交于 2019-12-20 10:54:10
问题 I am trying to edit bash_profile file to add path to my sdk through the following command on my mac machine. sudo touch ~/.bash_profile; open -e ~/.bash_profile It opens the file in TextEdit but does not allow me to edit it. Though i have given super-user permission and password while running the above command. It is giving me following message when i try to edit it. "You don’t own the file “.bash_profile” and don’t have permission to write to it. You can duplicate this document and edit the

RVM Warning! PATH is not properly set up

我只是一个虾纸丫 提交于 2019-12-20 08:27:42
问题 I just installed rvm on my mac, but I receive this warning on global commands Warning! PATH is not properly set up, '/usr/local/rvm/gems/ruby-1.9.3-p194/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 --auto-dotfiles', to fix temporarily in this shell session run: 'rvm use ruby-1.9.3-p194'. My $PATHS confirms the warning: $echo :$PATH: :/usr/local/rvm/bin:

Sublime Text 2 command line not working after Mavericks install

谁说我不能喝 提交于 2019-12-19 10:25:29
问题 I've ready through other threads on Stack Overflow and despite my efforts the issue doesn't seem to resolve. Since installing OS X Mavericks I'm not able to open Sublime Text 2 from the command line. I've tried following these guidelines: http://benkwok.wordpress.com/2013/11/17/setup-sublime-text-2-on-osx-mavericks-for-ruby-on-rails/ When I run this from the terminal Sublime pops up so that's good: http://benkwok.wordpress.com/2013/11/17/setup-sublime-text-2-on-osx-mavericks-for-ruby-on-rails

How to edit corrupted bash profile

谁说我不能喝 提交于 2019-12-18 09:48:57
问题 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? 回答1: Your terminal isn't broken, bash is just lost

RVM and bash_profile

岁酱吖の 提交于 2019-12-18 09:27:07
问题 I'm having problems installing RVM on my mac. I took my computer in to have the fan repaired so I'm using my wives trying to set up my environment to get some work done. The problem I'm having is the bash_profile. Every time I add the function: [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function and then reload the shell I get the following error: -bash: export: -s': not a valid identifier -bash: export: /Users/Christine/.rvm/scripts/rvm': not a valid

How to reload .bash_profile from the command line?

蓝咒 提交于 2019-12-17 04:08:44
问题 How can I reload .bash_profile from the command line? I can get the shell to recognize changes to .bash_profile by exiting and logging back in but I would like to be able to do it on demand. 回答1: Simply type source ~/.bash_profile Alternatively, if you like saving keystrokes you can type . ~/.bash_profile 回答2: . ~/.bash_profile Just make sure you don't have any dependencies on the current state in there. 回答3: Simply type: . ~/.bash_profile However, if you want to source it to run

How to make a bash_profile function acts different running within bash_profile or later called by user?

非 Y 不嫁゛ 提交于 2019-12-13 06:16:48
问题 I mean, in ~/.profile , a function doit will say Welcome when user login, but say other words when user execute doit later. doit() { if some_test_here; then echo "Running within ~/.profile. Welcome." else echo "Called by user." fi } doit I think ~/.profile is better on Mac for ~/.bash_profile on Linux. So I use ~/.profile as example. 回答1: Two ways to are to pass an argument, or to check the environment. Use an argument that is only used by the call in .profile . doit () { if [ "${1:-onlogin}"

How to echo OS X bash alias' command to terminal after calling it (like !cmd)?

99封情书 提交于 2019-12-13 05:57:46
问题 In ~/.bash_profile aliases are defined, eg. alias vaguppro='vagrant up --provision What I want is an echo of vagrant up --provision after typing vaguppro in the terminal. Similar to when one types ls -hal in the terminal, then again type !ls . There's an echo of ls -hal in the terminal before execution. SOME SOLUTIONS vaguppro='vagrant up --provision' alias vaguppro='echo $vaguppro && $vaguppro' or andlrc's function solution below. 回答1: You may find this shortcut useful: shell-expand-line (M

Python import modules from other packages

萝らか妹 提交于 2019-12-12 05:31:07
问题 Python will by default be looking for modules from lib/python2.7/site-packages But I'm now trying to import packages from other directories on HPCC, which I have to rely on, because I've no root access, it'll be difficult to install myself. But my question is: how to import modules from other directories? I've tried: export PYTHONPATH="/path/to/import/modules:$PYTHONPATH" But it's not working. What should I do? Thanks ========================================= My python to use is 2.7.9 ,so I