Computer Systems: A Programmer's Perspective (3rd Edition)
Computer Systems: A Programmer's Perspective (3rd Edition)
3rd Edition
ISBN: 9780134092669
Author: Bryant, Randal E. Bryant, David R. O'Hallaron, David R., Randal E.; O'Hallaron, Bryant/O'hallaron
Publisher: PEARSON
bartleby

Videos

Textbook Question
Book Icon
Chapter 8, Problem 8.20HW

Use execve to write a program called my1s whose behavior is identical to the /bin/ is program. Your program should accept the same command-line arguments, interpret the identical environment variables, and produce the identical output.

  The 1s program gets the width of the screen from the COLUMNS environment variable. If COLUMNS is Unset, then 1s assumes that the screen is 80 columns wide. Thus, you can check your handling of the environment variables by setting the COLUMNS environment to something less than 80:

linux> setenv COLUMNS

linux> ./my1s

.

. //Output is 40 columns wide

.

linux> unsetenv COLUMNS

linux> ./my1s

.

 //Output is now 80 columns wide

.

Blurred answer
Students have asked these similar questions
We want to develop a game where the user should guess a secret number. The game asks the user to input a number and tells how close it is to the secret random number that the game generates. Complete the main() function that implements this game by calling the get_user_input(), generate_secret(), and display_result(user_input, secret) functions that you will develop as follows: • Complete the get_user_input() function so that it prompts the user to enter a whole number between 1 and 20 (inclusive) and returns the number that the user enters. • Complete the generate_secret() function so that it generates and returns a random number between 1 and 20 (inclusive). • Complete the display_result(user_input, secret) function that takes the two parameters that correspond to the user input and the secret. It should then print the absolute difference between these two numbers. For example: Test Input Result random.seed (10) S Enter a number from 1 to 2015 You entered 5. The secret was 19. The…
We want to develop a game where the user should guess a secret number. The game asks the user to input a number and tells how close it is to the secret random number that the game generates. Complete the main() function that implements this game by calling the get_user_input(), generate_secret(), and display_result(user_input, secret) functions that you will develop as follows: • Complete the get_user_input() function so that it prompts the user to enter a whole number between 1 and 20 (inclusive) and returns the number that the user enters. • Complete the generate_secret() function so that it generates and returns a random number between 1 and 20 (inclusive). Complete the display_result(user_input, secret) function that takes the two parameters that correspond to the user input and the secret. It should then print the absolute difference between these two numbers. For example: Test Input Result random.seed (10) 5 random.seed(50) 6 Enter a number from 1 to 2015 You entered 5. The…
PLEASE ASSIST ON THE BELOW REVIEW Before the user can read an email, they have to see the emails. To achieve this, your program should first of all determine which emails have not been read and return that to the user. Then the user can choose. The emails should be numbered so that the user can provide the number as the index. Consider using the enumerate function to achieve this. I realise that there are no emails within the email box , kindly add some dummy emails in this list so that at least there is something within the inbox list.Do the same for marks as spam. Present to the user all the emails that have not been marked as spam for the user to mark as spam.Most importantly, your code is not well indented. Try to work on your indentation as it makes your code easier to read and the logic easier to follow. Indentation is key in python to define the blocks of statements. The number of spaces must be uniform in a block of code. It is preferred to use four whitespaces instead of tabs…
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Instruction Format (With reference to address); Author: ChiragBhalodia;https://www.youtube.com/watch?v=lNdy8HREvgo;License: Standard YouTube License, CC-BY