Write a script that takes one number between 1 and 10 from the user as an argumentto
Fantastic news! We've Found the answer you've been seeking!
Question:
Write a script that takes one number between 1 and 10 from the user as an argumentto the command and checks if a randomly generated number between 1 and 10matches the user supplied number. The program first checks to see if only oneargument 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.
Related Book For
Posted Date: