env command


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting env command
# 1  
Old 03-03-2011
env command

All,

what is env command used for in Unix?


Regards
Oracle User
# 2  
Old 03-03-2011
There is something called 'Environment Variables' which is set by default in a shell, when user login.
These variables are used by system processes, for the commands to work etc.

All these variables can be seen by the command 'env'
# 3  
Old 03-03-2011
The external env command creates a new environment for executing a given command. Depending on the options, env either uses the current environment or completely ignores it. If env uses the environment, modifications are made based on the arguments given. After the new environment is set up, the command argument is executed.

The env command is useful for testing commands in controlled environments. It may be used to execute a command in a new environment without affecting your own personal environment. It is probably used more to display the current environment than as a command executor.

Following is the general format of the env command.
env [ - ] [ name=value ... ] [ command [ options ] [ args ] ]
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to use env command to change GREP_OPTIONS variable?

How could I use the env command to change the enviroment variable GREP_OPTIONS so that grep is not case sensitive by setting it to "-i'? So that the command: grep a <<< A Will produce the same output as grep -i a <<< A (8 Replies)
Discussion started by: steezuschrist96
8 Replies

2. Web Development

Deny from env=env-variable Does not work

(Above from Apache docs). On my system, using: SetEnvIf User-Agent Mozilla IsBad=1 Order allow,deny Allow from all Deny from env=IsBad ...I see that environment variable is set (using phpinfo()) but the page is still served. No errors in the Apache logs. (1 Reply)
Discussion started by: gnurob
1 Replies

3. HP-UX

I want a HP-UX ENV,how could I?

just for practice,:) (1 Reply)
Discussion started by: freebsdjlu
1 Replies

4. Programming

HOME env

Do you know shell in Linux without HOME env. Best regards, Iliyan Varshilov (1 Reply)
Discussion started by: ilko_partizan
1 Replies

5. Shell Programming and Scripting

HOME env

Do you know shell in Linux without HOME env ? Best regards, Iliyan Varshilov Edit/Delete Message (1 Reply)
Discussion started by: ilko_partizan
1 Replies

6. Programming

Differece between "env" and "set" command

Hi, Please clarify what is the difference between "env" and "set" command. I guess set will display the system variables and user defined variables. Thanks Sweta (1 Reply)
Discussion started by: sweta
1 Replies

7. Shell Programming and Scripting

About command "env"

I am not sure about the command "env", what I understand now is it is setting the environment variable for a particular program. I have a program called myApp. My question is should myApp be running before I run the command env myKey=value1 myApp ? (1 Reply)
Discussion started by: jack1234
1 Replies

8. Shell Programming and Scripting

env

Hi, I want to check the path set for a particular variable.Like when i use "env" command ,so many variables are there.I have to search for that variable which i need.Instead can i have any cmd which i can directly check the path set for that variable except "echo $path_name" Thanks, ... (3 Replies)
Discussion started by: rrs
3 Replies

9. Shell Programming and Scripting

Adding command line env in cron env

Hello friends, i run two scripts manually & they work. i run them in cron & they don work. how to match the two env's 1.command line env 2.cron env i would like cron to use command line env. Thanks & Regards Abhijeet (1 Reply)
Discussion started by: abhijeetkul
1 Replies

10. Solaris

Env

hey guys!!!! i have a few question .. how to modify the user ENV in Sun Solaris 10 ... Thanks!!!! (1 Reply)
Discussion started by: giancarlodjabon
1 Replies
Login or Register to Ask a Question