Quantcast
Channel: BASH script to set environment variables not working - Ask Ubuntu
Browsing all 5 articles
Browse latest View live

Answer by silentsudo for BASH script to set environment variables not working

You Can try something like this CURRENT_DIR=`pwd` echo "SOME_PATH is pointing to ${CURRENT_DIR}" #Export SOME_PATH for current working directory export SOME_PATH=${CURRENT_DIR}

View Article



Answer by jlettvin for BASH script to set environment variables not working

I often want to set an environment variable without hassle. Here is what I add to my .bashrc to implement this convenience. defect() { if [ $1 ] && [ -z $2 ] then eval 'export DEFECT=$1' return...

View Article

Answer by user21322 for BASH script to set environment variables not working

export exports the variable assignment to child processes of the shell in which the export command was ran. Your command-line environment is the parent of the script's shell, so it does not see the...

View Article

Answer by con-f-use for BASH script to set environment variables not working

When you run a script, it runs in a subshell. Variables are only valid within the context of that subshell. Set them in your .bashrc or .profile and read up on variables and subshells. The export...

View Article

BASH script to set environment variables not working

I've written the following script to set some environment variables when needed. #!/bin/sh export BASE=/home/develop/trees echo $BASE export PATH=$PATH:$BASE echo $PATH Below the command and the...

View Article

Browsing all 5 articles
Browse latest View live




Latest Images