61cdc9a6e4
* Add(argument_check.md) Add argument check solution * Change(argument_check.md) Add objectives of script
391 B
391 B
Argument Check
Objectives
Note: assume the script is executed with an argument
- Write a script that will check if a given argument is the string "pizza"
- If it's the string "pizza" print "with pineapple?"
- 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!"