NagaLakshmi
NagaLakshmi

Reputation: 705

Accessing system wide environment variables inside a bash script

I've added a system wide environment variable in /etc/environment. I want to access this variable in a bash script. Is there any way to access it?

Upvotes: 2

Views: 6755

Answers (1)

sestus
sestus

Reputation: 1927

Assuming that PATH is an environmental variable, also in /etc/environment, I can access path in a script like this:

#!/bin/sh


echo $PATH

So what's wrong with your variable?

Upvotes: 4

Related Questions