docs(greatest-of-all): correct typos

This commit is contained in:
miguel 2023-01-11 16:03:06 +00:00 committed by MSilva95
parent 447de57f08
commit ab5b82d1bd
2 changed files with 4 additions and 6 deletions

View File

@ -1,7 +1,5 @@
#!/usr/bin/env bash
# Unofficial Bash Strict Mode
# set -euo pipefail
IFS='
'
script_dirS=$(cd -P "$(dirname "$BASH_SOURCE")" &>/dev/null && pwd)

View File

@ -4,11 +4,14 @@
Create a script `greatest-of-all.sh` which will ask you to input 10 numbers and then it will check what was the biggest number given. You must ask for the number using the string "Enter a number: " and then use the string "The largest number is: " to print the output like in the example below.
- Only positive numbers up to "10000" will be tested.
- If the given number is greater than "10000" you must print the error message "ERROR: The number entered is too large" and if its not a number or it is a negative number, print the error "ERROR: Invalid input only positive numerical characters are allowed". When either of these errors occurs, the script will print the error message, exit with an exit code of `1`, and will not continue to execute the next line.
### Usage
```console
$./greatest-of-all.sh
Enter a number: 1 # these numbers will be introduced either the user
Enter a number: 1 # these numbers will be introduced by the user
Enter a number: 2
Enter a number: 3
Enter a number: 4
@ -31,9 +34,6 @@ ERROR: The number entered is too large
$
```
- Only positive numbers up to "10000" will be tested.
- If the given number is greater than "10000" you must print the error message "ERROR: The number entered is too large" and if its not a number or it is a negative number, print the error "ERROR: Invalid input only positive numerical characters are allowed". When either of these errors occurs, the script will print the error message, exit with an exit code of `1`, and will not continue to execute the next line.
### Hints
The `if` condition in the shell is a control structure that allows you to execute a command or block of commands based on a specified condition. The if condition has the following syntax: