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.22HW

Write your own version of the Unix system function

int mysystem(char *command);

The mysystem function executes command by invoking /bin/ sh -c command, and then returns after command has completed. If command exits normally (by calling the exit function or executing a return statement), then mysystem returns the command exit status. For example, if command terminates by calling exit (8), then mysystem returns the value 8. Otherwise, if command terminates abnormally, then mysystem returns the status returned by the shell.

Blurred answer
Students have asked these similar questions
In this laboratory work, you are expected to write a c# console application to make someoperations about the customers. Operations and required featurest that you need to cover inyour program are following:• Add: This function adds a new person to json file. You need to get inputs from userand adds the new one into json file.• Display: This function displays all people in your json file.• Search: This function let you search with the user id.• Create Password: This function will create a random password for the user and usermay choose the length of the password. Password may include numbers andcharacters.• Exceptions: You need to handle exceptions as well. You should at least handle 3 ofexceptional cases. For the case that file can not be found, It is mandatory to catch theexception.
In python, rite a recursive function, displayFiles, that expects a pathname as an argument. The path name can be either the name of a file or the name of a directory. If the pathname refers to a file, its filepath is displayed, followed by its contents, like so: File name: file_path Lorem ipsum dolor sit amet, consectetur adipiscing elit... Otherwise, if the pathname refers to a directory, the function is applied to each name in the directory, like so: Directory name: directory_path File name: file_path1 Lorem ipsum dolor sit amet... File name: file_path2 Lorem ipsum dolor sit amet... ... Test this function in a new program.
Please assist, I am trying to modify the function so that it checks if the user is trying to register a name that already exists in user.txt, the appropriate message is displayed but it does not loop back to requesting the user to enter a new username. Instead it continues to request a password from the user. Here is what I have so far in Python. # Define a function to register a new user.def reg_user():    while True:        if menu == "r":            if user_name == "admin" and password == "adm1n":                new_user = input("Please enter a new username: ").lower()                with open ("user.txt", "r") as new_file:                    read_file = new_file.readlines()                    for file in read_file:                        read_file = file.split(",")                        if new_user == read_file[0]:                            print("Invalid input. This user already exists.")                    new_password = input("Please enter the password for the new user:…

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
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
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Instruction Format (With reference to address); Author: ChiragBhalodia;https://www.youtube.com/watch?v=lNdy8HREvgo;License: Standard YouTube License, CC-BY