Skip to content

Commit af8953e

Browse files
authored
Merge pull request #2 from khanna98/master
Conditionals
2 parents c067075 + 17c8fe8 commit af8953e

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

02-Conditionals/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Conditionals
2+
3+
This is a repo where you can create and practice conditionals in various languages.
4+
5+
The following language code has been added to far:
6+
1. bash

02-Conditionals/if-else.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
echo "Welcome to conditionals"
4+
5+
todayDate=$(date +%d)
6+
today=$(date +'%d/%m/%Y')
7+
echo "Today is $today."
8+
if [ $todayDate -ge 15 ]
9+
then
10+
echo "Congrats half the month is over !"
11+
else
12+
echo "Come on work hard. Its not even the half of the month"
13+
fi

0 commit comments

Comments
 (0)