Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 5956

How do you give su the current user environment variables

$
0
0

I have a variable that is set through .bashrc.

In ~/.bashrc:

PROJ_HOME=~/Projects/stable

From a bash shell, I'd like to do something like this:

$ su -l kenneth -c 'echo $PROJ_HOME'

However, when I do this, the expected /home/kenneth/Projects/stable is not printed out.

Any ideas on how I can do this?


Viewing all articles
Browse latest Browse all 5956

Trending Articles



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