Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a script that takes one number between 1 and 10 from the user as an argument to the command and checks if a randomly

Write a script that takes one number between 1 and 10 from the user as an argument to the command and checks if a randomly generated number between 1 and 10 matches the user supplied number. The program first checks to see if only one argument has been provided by the user otherwise flags that an error. $ your_script 5 #will tell you if the computer also generated the same number $ your_script #will tell you that no args were supplied You can use $# to check for the number of supplied args.

-----------------------------------------------------------------------------------------------------

Q2

Write a script that checks to see if at least one argument has been given on the command line and tests whether the argument is the name of an ordinary file (not a directory or other type of file) in the working directory.

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_2

Step: 3

blur-text-image_3

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

Big Data, Mining, And Analytics Components Of Strategic Decision Making

Authors: Stephan Kudyba

1st Edition

1466568704, 9781466568709

More Books

Students also viewed these Databases questions

Question

74 Motivation concepts and applications.

Answered: 1 week ago

Question

Consider this article:...

Answered: 1 week ago

Question

How do Data Types perform data validation?

Answered: 1 week ago

Question

How does Referential Integrity work?

Answered: 1 week ago