write a bash shell program named L1 as follows . L1 expects exactly 2 command line...

90.2K

Verified Solution

Question

Programming

write a bash shell program named L1 as follows . L1 expectsexactly 2 command line arguments. expects $1 to contain onlydigits. expects $2 to have exactly 4 characters (can be anycharacter).

if NOT exactly 2 command line arguments, echo \"need 2 args \" andexit.

otherwise, if $1 and/or $2 have incorrect value(s) (as above),echo \"bad argX\", where X is the first incorrect argument, andexit.

otherwise, echo \"good \". you can use echo,grep, pipe to check ifthe argument have the required characters.

example:

>L1 849474 0-=~

good

>L1 47347 8x

bad arg2

>L1 123abc 8d

bad arg1

Answer & Explanation Solved by verified expert
3.9 Ratings (451 Votes)
binbashCreating a regular expression which will accept    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students