How can you get/set an environment variable from a program?



How can you get/set an environment variable from a program?..

Answer / Roshni Kumari

You can get an environment variable using the getenv() function in C and set it by using setenv(), unsetenv(), or putenv(). In shell scripts, you can use export to set variables and print them with echo.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Unix General Interview Questions

What is the architecture of unix operating system?

1 Answers  


Is unix cli or gui?

1 Answers  


Explain Sticky bit?

1 Answers  


How to get the last word from a line in Unix file?

1 Answers  


What are positional parameters in unix?

1 Answers  


What is buffer header unix?

1 Answers  


Explain how do you create special files like named pipes and device files?

1 Answers  


How is unix different from other operating system?

1 Answers  


What does the swapping system do if it identifies the illegal page for swapping?

1 Answers  


Describe the term inode?

1 Answers  


I want to invest in learning things that will get me good jobs in future. But wondering if Unix knowledge is something that is a MUST have or is it better to do any Data-warehouse tool (cognos, Qclik view, ETL etc..). Please suggest me.

1 Answers  


How to display n-th line of a file in Unix?

1 Answers  


Categories