Browse Source

docs(greatest-of-all): correct typos

pull/1717/head
miguel 2 years ago committed by MSilva95
parent
commit
ab5b82d1bd
  1. 2
      sh/tests/greatest-of-all_test.sh
  2. 8
      subjects/devops/greatest-of-all/README.md

2
sh/tests/greatest-of-all_test.sh

@ -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)

8
subjects/devops/greatest-of-all/README.md

@ -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:

Loading…
Cancel
Save