Skip to main content
replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/
Source Link

env is a POSIX 7 way:

export asdf=qwer
env | grep asdf

Sample output:

asdf=qwer

It only shows exported variables: non-exported variables are not usually considered "environment variables".

Prefer that over printenv, which is not POSIX. Both seem to do the same thing without arguments: http://unix.stackexchange.com/questions/123473/what-is-the-difference-between-env-and-printenvhttps://unix.stackexchange.com/questions/123473/what-is-the-difference-between-env-and-printenv

env is a POSIX 7 way:

export asdf=qwer
env | grep asdf

Sample output:

asdf=qwer

It only shows exported variables: non-exported variables are not usually considered "environment variables".

Prefer that over printenv, which is not POSIX. Both seem to do the same thing without arguments: http://unix.stackexchange.com/questions/123473/what-is-the-difference-between-env-and-printenv

env is a POSIX 7 way:

export asdf=qwer
env | grep asdf

Sample output:

asdf=qwer

It only shows exported variables: non-exported variables are not usually considered "environment variables".

Prefer that over printenv, which is not POSIX. Both seem to do the same thing without arguments: https://unix.stackexchange.com/questions/123473/what-is-the-difference-between-env-and-printenv

Source Link

env is a POSIX 7 way:

export asdf=qwer
env | grep asdf

Sample output:

asdf=qwer

It only shows exported variables: non-exported variables are not usually considered "environment variables".

Prefer that over printenv, which is not POSIX. Both seem to do the same thing without arguments: http://unix.stackexchange.com/questions/123473/what-is-the-difference-between-env-and-printenv