Write a program that displays all environment variables

Assignment Help Computer Engineering
Reference no: EM131876600

Problem

1. Write a program that displays all environment variables.

2. Write a program that sets an int variable x to 100 before forking a child. Next perform the following in the child and parent: Child:

(i) Display the value of x, reset it to 200, and display it again.

(ii) Display the value of PATH, reset it to only ., and display it again.

(iii) Change the current directory to /etc and display the absolute pathname of the changed directory.

Parent:

(i) Sleep for 2 seconds.

(ii) Display the value of x, PATH, and the pathname of the current directory.

Explain your observations. Why was the parent made to sleep for two seconds?

Reference no: EM131876600

Questions Cloud

Calculate net sales : Net Sales Based on the following, calculate net sales? Gross Profit and Net Income From the following information, calculate Gross Sales?
Calculate the present value of net benefits : Calculate the present value of net benefits for the project using the analysts' predictions.
What behaviors are used to demonstrate that resistance : What lessons can you take from this experience concerning the nature of resistance and methods for overcoming resistance to change?
What is the total annual cost of setting up production runs : The new Toyota production plant starting up in Guanajuato, in central Mexico would be manufacturing a radical new Corolla Compact that will go on sale in 2020.
Write a program that displays all environment variables : Write a program that displays all environment variables. Write a program that sets an int variable x to 100 before forking a child.
What is role of memory management unit in process switching : What is the role of the Memory Management Unit in process switching? Why can't one process corrupt the address space of another?
Explain why a pipe can connect two related processes only : Why can't a background process be terminated with the interrupt key? Explain why a pipe can connect two related processes only.
Write a shell script containing only one statement : Write a shell script containing only one statement: exit 123456. Run the script and then invoke echo $? from the shell.
Write program that display pids and ppids of three processes : Write a program that forks twice. Display the PIDs and PPIDs of all three processes. Write a program that executes command wc -l -c /etc/passwd using execl.

Reviews

Write a Review

Computer Engineering Questions & Answers

  What are the two basic forms of compression

What are the two basic forms of compression? Run-length encoding can be used to compress what kind(s) of data?

  Calculate the greatest common divisor tasks

A number of Java classes to implement Calculate Pi, Calculate Primes and Calculate the Greatest Common Divisor tasks

  How have the assumptions in the models changed

Recent predictions for population growth in the 21st century have changed quite a bit from predictions made. How have the assumptions in the models changed?

  Discuss digital data signal and analog data signal

Data transmission can occur by way of analog signal or digital signal. In your own words, discuss digital data signal and analog data signal. Which do you think is better, and why

  How will film affect radiation heat transfer through window

Consider a double-pane window whose air space width is 20 mm. Now a thin polyester film is used to divide the air space into two 10-mm-wide layers.

  How to generate the computer code

I have not seen them yet, but the wave appears to be toward a complete English ability to write down computer programs.

  How many ways a committee of 4 people can be choosen

The question of how various ways a committee of 4 people can be selected from a group of 10 is known as a combination. The notation in general for counting the number of ways of selecting r items from a group of n is C(n,r) = n! / r!(n-r)!

  Create a program for an automatic teller machine

Write a program for an automatic teller machine that dispenses money. The user should enter the amount desired (a multiple of 10 dollars) and the machine dispenses this amount using the least number of bills.

  Describe the two site examples which have images or

what are two site examples that have images or multimedia that are used effectively on the site? why do you think they

  Examine the present options available for use of tcpip and

write a 4-7 page paper including the following analyze the current options available for use of tcpip and osi models

  Questiona queue has definite characteristics as listed

questiona queue has definite characteristics as listed below-head-the next item to exit queue is always the

  Discusses conventional binary computing architecture

Find and summarise a resource that explains why there is so much interest in this type of computing - The text briefly makes mention of the Linux operating system.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd