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

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

$
0
0

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 0
    else
        echo 'Usage: defect {number}'
        return 1
    fi
}

Viewing all articles
Browse latest Browse all 5

Trending Articles



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