Add(argument_check.md) Add argument check solution (#323)

* Add(argument_check.md) Add argument check solution

* Change(argument_check.md) Add objectives of script
This commit is contained in:
G. A. Gama 2022-12-04 17:20:34 -03:00 committed by GitHub
parent 7c00bca649
commit 61cdc9a6e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,17 @@
## Argument Check
### Objectives
Note: assume the script is executed with an argument
1. Write a script that will check if a given argument is the string "pizza"
2. If it's the string "pizza" print "with pineapple?"
3. If it's not the string "pizza" print "I want pizza!"
### Solution
```
#!/usr/bin/env bash
[[ ${1} == "pizza" ]] && echo "with pineapple?" || echo "I want pizza!"
```