There was an error while loading. Please reload this page.
1 parent 7c00bca commit 61cdc9aCopy full SHA for 61cdc9a
topics/shell/solutions/argument_check.md
@@ -0,0 +1,17 @@
1
+## Argument Check
2
+
3
+### Objectives
4
5
+Note: assume the script is executed with an argument
6
7
+1. Write a script that will check if a given argument is the string "pizza"
8
+2. If it's the string "pizza" print "with pineapple?"
9
+3. If it's not the string "pizza" print "I want pizza!"
10
11
+### Solution
12
13
+```
14
+#!/usr/bin/env bash
15
16
+[[ ${1} == "pizza" ]] && echo "with pineapple?" || echo "I want pizza!"
17
0 commit comments