Browse Source

if statement with date command

master
Anthony Fadly 1 year ago
parent
commit
2438004468
1 changed files with 11 additions and 0 deletions
  1. 11
    0
      oct1.md

+ 11
- 0
oct1.md View File

@@ -59,6 +59,7 @@ Monday
```

## If Statement

```
#!/bin/bash
if [[ boolean ]]; then
@@ -67,3 +68,13 @@ else
echo "false"
fi #end if
```

## If Statement with Date Command

```
#!/bin/bash # ShaBang for Bash Script

DAY_OF_WEEK=$(date +%A) # set var to output of date command eg "Monday"

if [[ "$DAY_OF_WEEK" == "Monday" ]]
```

Loading…
Cancel
Save