Quantcast
Channel: How can I set an environment variable only for the duration of the script? - Stack Overflow
Viewing all articles
Browse latest Browse all 5

How can I set an environment variable only for the duration of the script?

$
0
0

On Linux (Ubuntu 11.04 (Natty Narwhal)) in Bash, is it possible to temporarily set an environment variable that will only be different from the normal variable for the duration of the script?

For example, in a shell script, making an application that saves to HOME portable by temporarily setting HOME to a folder in the present working directory, and then launching the application.


Viewing all articles
Browse latest Browse all 5

Trending Articles



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