Quantcast
Viewing latest article 5
Browse Latest Browse All 5

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 results I can see on my terminal: the script runs, but the variables are not set at the end.

~$: ./script.sh
/home/develop/trees
/bin:......:/home/develop/trees
~$: echo $BASE

~$: 

What's wrong? Thanks in advance. Mirko


Viewing latest article 5
Browse Latest Browse All 5

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>