Question: CPP Unix System calls questions Need help completing the last part of this problem d-p chdir(playarea); system(echo 'List the files in the playarea directory: ';

CPP Unix System calls questions

Need help completing the last part of this problem d-p

chdir("playarea"); system("echo 'List the files in the playarea directory: '; ls"); system("echo 'Remove files 'foxes' and 'wolves' from the directory'; rm -f foxes wolves"); system("echo -e 'THE QUICK BROWN FOX has 3 brother foxes and 4 sister foxes. BUT she is the slowest of all' > foxes"); /* d) List the files in the playarea directory, and display the contents of file foxes. e). Make a copy of 'foxes' called 'foxes_saved'.

f) List the files in the playarea directory.

g) Use sed to edit file foxes, replacing the word 'foxes' with 'wolves'. Output should be displayed on standard output/screen.

h) Perform a command that pipes the result from (g) into a sed command to replace the phrase 'BROWN FOX' with 'GRAY WOLF'. Output should be displayed on standard output/screen.

i) Perform the command from (h) and redirect output a file named 'wolves'.

j) Append the line "END OF WOLF PACK' to the end of file 'wolves'.

k) Copy the file wolves into your home directory.

l) Move to your home directory, an list the files in your home directory.

m) Read in a file name from the keyboard.

n) Display the name entered in the keyboard as "NEW FILE NAME = xxxxxxx"

o) Copy the file wolves into that file.

p) List the files in your home, and display the contents of the newly created file. */

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!