-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript_one.sh
More file actions
executable file
·56 lines (51 loc) · 1023 Bytes
/
script_one.sh
File metadata and controls
executable file
·56 lines (51 loc) · 1023 Bytes
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
#!/bin/bash
month_number=$1
if [ -z $month_number ]
then
echo "No month number given. Please enter a month number as a command line argument."
echo "eg: ./print-month-number 5"
exit
fi
if [[ $month_number -lt 1 ]] || [[ $month_number -gt 12 ]]
then
echo "Invalid month number given. Please enter a valid number - 1 to 12."
exit
fi
if [ $month_number -eq 1 ]
then
echo "January"
elif [ $month_number -eq 2 ]
then
echo "February"
elif [ $month_number -eq 3 ]
then
echo "March"
elif [ $month_number -eq 4 ]
then
echo "April"
elif [ $month_number -eq 5 ]
then
echo "May"
elif [ $month_number -eq 6 ]
then
echo "June"
elif [ $month_number -eq 7 ]
then
echo "July"
elif [ $month_number -eq 8 ]
then
echo "August"
elif [ $month_number -eq 9 ]
then
echo "September"
elif [ $month_number -eq 10 ]
then
echo "October"
elif [ $month_number -eq 11 ]
then
echo "November"
elif [ $month_number -eq 12 ]
then
echo December
fi
#Added this message to test commited changes to the main branch via git