Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a PERL script to help users calculate compressed file size. NEED SCREENSHOTS Prompt the user to enter the original size of a file (in

Write a PERL script to help users calculate compressed file size. NEED SCREENSHOTS

Prompt the user to enter the original size of a file (in bytes) from the keyboard. Then use the following rules for calculating the compressed file size.

Display the result on the screen. If the size is less than 5000 bytes, the compression ratio is 90%. If the size is between 5000 and 50000 bytes, the compression ratio is 70%.

If the size is more than 50000 bytes, the compression ratio is 40%.

2. Develop a small Perl console program driven by a text menu (see the sample screenshot below): It displays a simple menu with 4 items indicated by number 1-4. Users will enter number 1 to 4 to run some commands. Item #1 to #3 will run some shell commands (its your choice what to run, but do not use the same commands as in the example). When the command is finished, display the menu again. If 4 is entered, then quit the program.

Sample Screenshot

Welcome to Menu:

1.) ls

2.) ls -i

3.) ls -a

4.) Exit

Please enter a choice 1-4: 1

case.sh file-test.sh menu.sh script-args.sh timer.sh

compund.sh for.sh math.sh pattern.sh simple-script.sh while.sh

Welcome to Menu:

1.) ls

2.) ls -i

3.) ls -a

4.) Exit

Please enter a choice 1-4: 4

Exit ...

root@ubuntu0:~/Documents/script#

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

Business Process Driven Database Design With Oracle PL SQL

Authors: Rajeev Kaula

1st Edition

1795532386, 978-1795532389

More Books

Students also viewed these Databases questions

Question

3. Is there opportunity to improve current circumstances? How so?

Answered: 1 week ago