Friday, August 17, 2018

Environment Variables

If we create any variable to store something in the environment (Shell) these are called as environment variables.

$env --> To show all the list of environment variables for each user available.

To create a variable
--------------------
<variable-name> = <value>

My Notation: <> Represents arbitrary values.

Ex: MyHome = Uday

To display it, echo $MyName
If not exists, just displays empty data.

OS also stores some default environment variables.

We can set one environment variables in login scripts to make them available everytime we login.

which command
--------------------
shows the location of the command.
Ex: which ls

Some environment variables.:
PATH = It we run a command without complete path, shell searches for it in the locations specified in PATH variable(separated by semicolon)

In the profile script add a new app location
PATH = $PATH;<new_path>

No comments:

Post a Comment