How to get or set an environment variable from a program?



How to get or set an environment variable from a program?..

Answer / Rajkumar

To get the value of an environment variable in Unix, you can use the 'getenv()' function. To set an environment variable, you can use the 'setenv()' function. Both functions are part of the standard C library.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Unix IPC Interview Questions

set-user-id is related to (in unix)

1 Answers  


Explain what are the system calls used for process management?

1 Answers  


How to write the program on full-duplex communication on biderctional(e.g using two pipes)

2 Answers   Infosys,


What is IPC? What are the various schemes available?

5 Answers  


How to write the program on full-duplex communication on bidirectional(e.g using two pipes)?

1 Answers  


Explain the system calls used for process management?

1 Answers  


Describe the initial process sequence while the system boots up?

4 Answers  


How can a parent and child process communicate?

3 Answers   TCS,


Explain the advantage of executing a process in background?

1 Answers  


What is the condition required for dead lock in unix system?

1 Answers  


how to create tree of processes. one parent and 3 childs.

1 Answers   HCL,


What are the system calls used for process management:

5 Answers  


Categories