-
Notifications
You must be signed in to change notification settings - Fork 1
/
ifloop1.sh
executable file
·71 lines (42 loc) · 920 Bytes
/
ifloop1.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
# Script Name My First If Loop
# Author Bill Kachersky
# Date of last revision 08/02/2021
# Description of purpose To Create and Test If Loops
# Functions
Query () {
echo "What should we name it?"
}
# Arrays
workingdir=(ls)
# Friendly Greeting
echo "We need that directory up and running yesterday, otherwise we're going to miss our deadline, are you ready?"
sleep 2
echo "Well? (Y)es or (N)o?"
read rpl
if [[ $rpl == Y || $rpl == Yes ]]
then
Query
else
echo "Way to be a team player, $USER."
exit
fi
read cfm
if [ ! -d "$cfm" ]
then
sleep 2
echo "Directory $cfm DOES NOT exist."
sleep 2
echo "Great, let's create it then."
sleep 2
mkdir $cfm
echo "Complete!"
sleep 2
${workingdir[@]}
sleep 2
echo "Thanks for your help."
elif [ -d "$cfm" ]
then
echo "Hmmm.. already taken."
sleep 2
fi