Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a function in UNIX that will take a filename as input. If the file exist, it will display the content of the file. Next

Write a function in UNIX that will take a filename as input.

If the file exist, it will display the content of the file. Next use the case structure to display a command menu, and prompt the user for selection. Depending on the users selection, the user is allowed to write, append, edit the file, or exit the menu. In case the users selection is invalid, prompt the user no valid selection is made.

If the file doesnt exist it will open the file in vi or vim. So you can write in the file and save it.

COMMAND MENU

Enter 1 to write to file (Using cat)

Enter 2 to append to file (Using cat)

Enter 3 to edit file (Open vi or vim)

Enter 4 to exit menu (Display ByeBye and exit from program)

Example 1

Enter a filename.

cocolor

Displaying the file:

red blue yellow green pink purple indigo orange black white

COMMAND MENU

Enter 1 to write to file

Enter 2 to append to file

Enter 3 to edit file

Enter 4 to exit menu

Enter an option:

4

BYE BYE

Example 2

Enter a filename.

newFile

Creating a new file called newFile :

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Oracle8I Building Efficient Databases

Authors: Jonathan Lewis

1st Edition

0201715848, 978-0201715842

More Books

Students also viewed these Databases questions

Question

1. Explain the purpose of performance appraisal.pg 87

Answered: 1 week ago

Question

=+ a. How does this change affect the incentives for working?

Answered: 1 week ago