.bash-profile

How do sudo environment variables work in linux?

ε祈祈猫儿з 提交于 2020-01-13 20:28:50
问题 I'm currently perplexed by the following: sudo echo $MYVAR outputs my variable from my .bashrc, but sudo ./test.sh does not, where test.sh is the below executable: #!/bin/sh echo $MYVAR I'm running Ubuntu 14.04. Can someone enlighten me as to what's going on here? 回答1: When you run sudo echo $MYVAR , the environment variable is expanded in your shell ... before the sudo command gets to see it. When you run a script using sudo , that script only sees the environment variables that sudo has

How do sudo environment variables work in linux?

为君一笑 提交于 2020-01-13 20:28:05
问题 I'm currently perplexed by the following: sudo echo $MYVAR outputs my variable from my .bashrc, but sudo ./test.sh does not, where test.sh is the below executable: #!/bin/sh echo $MYVAR I'm running Ubuntu 14.04. Can someone enlighten me as to what's going on here? 回答1: When you run sudo echo $MYVAR , the environment variable is expanded in your shell ... before the sudo command gets to see it. When you run a script using sudo , that script only sees the environment variables that sudo has

Why is my Vagrant bootstrap file not modifying bash_login?

我的未来我决定 提交于 2020-01-05 05:44:25
问题 When I SSH into my Vagrant box, I would like it to run the following two commands; cd /vagrant git status So naturally I would modify my ~/.bash_login to do this cat << EOF | sudo tee -a ~/.bash_login cd /vagrant git status EOF If I then exit, and ssh back into my box - it works! So then I added those exact commands to my bootstap.sh provisioning file, so that each time my box is provisioned, it would add it automatically to my bash_login script. Except it doesnt work. The output during

PostgreSQL command psql not found, trouble adding to $PATH

早过忘川 提交于 2020-01-04 01:50:16
问题 I am trying to add PostgreSQL to my $PATH variable. I tried this to see where psql is whereis psql To which I got a null response. I do have the PostgreSQL.app installed so I clicked on "Open psql" from the GUI and it prompted the Terminal to open and display: /Applications/Postgres.app/Contents/MacOS/bin/psql; exit; So I tried to add the above to the $PATH variable in my ~/.bash_profile (which may have its own problems since I don't know if you can add paths with .app extensions to the $PATH

Why doesn't Fabric see my .bash_profile?

和自甴很熟 提交于 2019-12-30 06:01:13
问题 In Fabric, when I try to use any alias' or functions from my .bash_profile file, they are not recognized. For instance my .bash_profile contains alias c='workon django-canada' , so when I type c in iTerm or Terminal, workon django-canada is executed. My fabfile.py contains def test(): local('c') But when I try fab test it throws this at me: [localhost] local: c /bin/sh: c: command not found Fatal error: local() encountered an error (return code 127) while executing 'c' Aborting. Other Fabric

BASH: different colour for text entered by user

五迷三道 提交于 2019-12-25 12:38:06
问题 I've been tidying up my BASH prompt. Currently it looks like this: Here is the code: # NOTE: OSX uses .bashprofile http://superuser.com/questions/244964/mac-os-x-bashrc-not-working # http://mywiki.wooledge.org/BashFAQ/037 bold=$( tput bold || tput md ) black=$( tput setaf 0 ) red=$( tput setaf 1 ) green=$( tput setaf 2 ) blue=$( tput setaf 4 ) white=$( tput setaf 7 || tput AF 7 ) RESET=$( tput sgr0 ) # https://github.com/sickill/stderred export DYLD_INSERT_LIBRARIES="/usr/lib/libstderred

How to set a path in ubuntu such that i can run my eclipse-juno in terminal

故事扮演 提交于 2019-12-25 00:24:31
问题 I want to set PATH var in ubuntu such that i can run my programs by just giving their name in terminal. I created a folder /home/vignesh/bin and keep my eclipse folder there and in ~/.bashrc is gave this command: export PATH=${PATH}:/home/vignesh/bin/eclipse/eclipse (I logging out and logging in again) but when i type eclipse i get this message in terminal as: The program 'eclipse' is currently not installed. You can install it by typing: apt-get install eclipse-platform 回答1: Update the /etc

Bad Interpreter: No such file or directory error when launching iPython with Anaconda

…衆ロ難τιáo~ 提交于 2019-12-24 12:44:30
问题 My ipython was working fine until I installed a new IDE and accidentally changed some path settings. Now, when I try to launch ipython from terminal I get: -bash: /Users/JohnSmith/anaconda/bin/ipython: /Users/JohnSmith/anaconda/python.app/Contents/MacOS/python: bad interpreter: No such file or directory How do I change my path/local environment settings back so that it works? 回答1: It seems that uninstalling and re-installing Anaconda was the easiest solution (after several hours of playing

RVM not working after installing properly?

耗尽温柔 提交于 2019-12-24 02:23:49
问题 Ok so I had RVM working before but after I upgraded to Mountain Lion it appears to be gone? So I tried reinstalling it: Ayman$ curl -L https://get.rvm.io | bash -s stable % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 185 100 185 0 0 200 0 --:--:-- --:--:-- --:--:-- 755 100 9979 100 9979 0 0 5911 0 0:00:01 0:00:01 --:--:-- 5911 Downloading RVM from wayneeseguin branch stable % Total % Received % Xferd Average Speed Time Time Time

NGINX brew install command not found

99封情书 提交于 2019-12-22 04:13:19
问题 I do $ brew install nginx and get: ==> Downloading http://nginx.org/download/nginx-1.2.2.tar.gz Already downloaded: /Library/Caches/Homebrew/nginx-1.2.2.tar.gz ==> Patching patching file conf/nginx.conf ==> ./configure --prefix=/usr/local/Cellar/nginx/1.2.2 --with-http_ssl_module --with-pcre --with-ipv6 --with-cc-opt=-I/usr/local/include --with-ld-opt=-L/usr/local/lib --conf ==> make ==> make install ==> Caveats In the interest of allowing you to run `nginx` without `sudo`, the default port