TERM environment variable not set on mac - macos

I keep on getting the "TERM environment variable not set." error when I work with svn commands on my Mac terminal.
I thought I had set up my profile by doing:
export SVN_EDITOR=/usr/bin/nano
export EDITOR=/usr/bin/nano
in .profile and .bash_profile, reset the terminal and it still gives me that error.
Any help?

Add this to your profile:
export TERM=xterm-color

Related

Why do my $PATH environment always reset after I open a new terminal on my mac?

Usually I will nano .zsh_profile
Then I will edit the path
#PYTHON
export PATH=/Users/ffff/Library/Python/3.8/bin:$PATH
# JAVA
export JAVA_HOME=$(/usr/libexec/java_home)
export PATH=$JAVA_HOME/bin:$PATH
#ANDROID
export ANDROID_HOME=/Users/ffff/Library/Android/sdk
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/tools:$PATH
export PATH=$ANDROID_HOME/tools/bin:$PATH
then I will save and exit
Then I will
source .zsh_profile
I will test the Java and ADB all is good, but one I open a new Terminal from my mac, it will say ADB and JAVA and Android_HOME not found
Why is it not persist? Did I miss out anything? My mac version is 12.2.1
The .zsh_profile file, has no special meaning. This is probably a confusion form Bash, where the bash_profile is executes for login shells. In Zsh, that equivalent would be ~/.zprofile. You might have some code in your .zshrc file, that overrides the PATH variable with something else. Because, as oppsed to .zprofile, the .zshrc file gets executed for every interactive non-login shells.
So my advice, checkout .zshrc and see if there's something overriding the PATH there, if so, maybe you want to change that, and NOT to execute these commands you want to add for every time a shell is opened, you should put them in .zprofile, so they only get executed once at login.

How to set path variables on osx el capitan?

I've not had success setting up an environment variable on El Capitan. Nothing to do with dock or bash shell. Trying to run a java gui which requires an environment path variable to a JDBC driver to connect to an oracle db:
http://docs.oracle.com/cd/E11882_01/install.112/e38228/inst_task.htm#BABBBHJH
I have tried methods:
in launchd.conf:
setenv JDBC /Users/mac_admin/Downloads/Oracle/instantclient_12_1
osx - Setting environment variables in OS X? - Stack Overflow
in .profile:
export JDBC /Users/mac_admin/Downloads/Oracle/instantclient_12_1
terminal - How do I set environment variables on OS X? - Ask Different
in .bash_profile:
export JDBC=$(/Users/mac_admin/Downloads/Oracle/instantclient_12_1)
Where to Set Environment Variables in Mac OS X
In each case, the export command at Terminal does not show the new variable.
What is correct method for El Capitan?
Is "JDBC" an acceptable name for the variable? Or am I supposed to label it PATH? I notice the export command already lists a PATH item, and I am afraid to overwrite it:
declare -x PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Frameworks/Mono.framework/Versions/Current/Commands"
Is /Users/mac_admin/Downloads/Oracle/instantclient_12_1 an acceptable location for the files?
thx
It kind-of matters where you want to use this. If you are just trying to get some binary utility to run from Terminal shells you launch add an export into ~/.bash_profile and you are good to go: export JDBC='Robert was here'
tcc-rkuhar:scouting robert.kuhar$ source ~/.bash_profile
tcc-rkuhar:scouting robert.kuhar$ echo $JDBC
Robert was here
You need the equals sign to get the environment variable set. Assuming that the value you've put in the export JDBC is a directly that has the binaries you want to execute. The line in your ~/.bash_profile is probably...
export JDBC=/Users/mac_admin/Downloads/Oracle/instantclient_12_1
PATH="${PATH}:$JDBC"
You'll know this worked if you
echo $PATH
/usr/local/bin:...blah...blah...blah::/Users/mac_admin/Downloads/Oracle/instantclient_12_1

Unable to open bash profile on OSX

I am unable to open bash profile. I had set the Java and Android path but suddenly it is opening. But when I run echo $PATH it is displaying the paths correctly. Now I need to add path to bash profile.
Could anyone please help me?
Your $PATH is wrong :
/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/bin:/Users/qsgte‌​chnologies/Library/Android/sdk/platform-tools:/Users/qsgtechnologies/Library/Andr‌​oid/sdk/tools
This doesn't use standard default path, and, unless this is totally intentional, I recommend you not to do this.
You've got to fix it running this (note /bin:/usr/bin:):
export PATH=/bin:/usr/bin:/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/bin:/Users/qsgte‌​chnologies/Library/Android/sdk/platform-tools:/Users/qsgtechnologies/Library/Andr‌​oid/sdk/tools:
The next time, be sure to use this syntax:
export PATH=$PATH/YourNewPath:
Since you removed /bin:/usr/bin: you where unable to change your bash profile because bash wasn't able to locate your executables.
Fitting your needs, here's your current bash_profile:
export JAVA_HOME=$(/usr/libexec/java_home)
export ANDROID_HOME=/Users/qsgtechnologies/Library/Android/sdk
export PATH=$JAVA_HOME/bin:/usr/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools
Change it to (note that YourNewEntry is a placeholder for the value you need)
export JAVA_HOME=$(/usr/libexec/java_home)
export ANDROID_HOME=/Users/qsgtechnologies/Library/Android/sdk
export PATH=$JAVA_HOME/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools:/YourNewEntry
Then apply your changes:
source ~/.bash_profile

$GOPATH value keeps reseting to empty during new sessions of the terminal

I have installed GO on my Mac Book using the 10.8+ installer from golang.org, and I have set up a workspace. After running both these commands: export GOPATH=$HOME/go and export PATH=$PATH:$GOPATH/bin, echoing the GOPATH does return a value of /Users/dipen/go; however, after restarting the terminal, the echoing the GOPATH returns nothing. How can I fix this?
Add these lines to your ~/.bashrc or ~/.bash_profile:
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin

set env var in mac doesn't take an effect

I have tried to set env var in Mac.
$ open ~/.bash_profile
shows:
export ADB_PATH=~/MyWorkspace/sdk/platform-tools/adb
export PATH=$PATH:$ADB_PATH
I have restarted the machine but no effect:
$ adb
-bash: adb: command not found
what can be wrong?
update
have tried this too, with no help:
export ADB_PATH=~/MyWorkspace/sdk/platform-tools
export PATH=$PATH:$ADB_PATH/adb
or
export PATH=$PATH:~/MyWorkspace/sdk/platform-tools
Entries in the PATH environment variable should be directories, not individual binaries. Change your PATH to:
export PATH=$PATH:~/MyWorkspace/sdk/platform-tools

Resources