Skip to content

Commit 61cdc9a

Browse files
authored
Add(argument_check.md) Add argument check solution (bregman-arie#323)
* Add(argument_check.md) Add argument check solution * Change(argument_check.md) Add objectives of script
1 parent 7c00bca commit 61cdc9a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)