Bash function to check if it's friday

Posted on 23.11.17   Bash Humor Linux

Ever wondered if today’s Friday? Yeah me too, every day.

Keep yourself updated with this simple function.

 

1) Open your profile settings file
nano ~/.bashrc

2) Enter the following function in the bottom

yay() {
    day=$(date +%u)
    if [ "$day" == "5" ];
    then
        echo "YAY, IT'S FRIDAY!!!"
    else
        echo "Not to bring you down, but it's not friday yet :("
    fi
}

3) Reload your config file
. ~/.bashrc

4) Try it out! Just type yay in your terminal window whenever you wonder if it’s Friday or not.

More on ITDB

Fix twitchy/wobbling touchpad for Ubuntu based distributions


Create a cmd alias/shortcut for issuing commands on remote computer


Managing WiFi profiles in Windows 10


How to debug a non starting application with ProcMon


Turn off CTRL + ALT + DEL at login prompt Windows 10