#!/bin/bash #Lab 2 Question 1 IFS=': ' login=`whoami` echo $login line=`grep $login /etc/passwd` echo $line read -a line_ar <<< $line name=${line_ar[4]} echo $name date1=`date` read -a date_arr <<< $date1 day_short=${date_arr[0]} if [ $day_short == "Mon" ]; then d="Monday" elif [ $day_short == "Tue" ]; then d="Tuesday" elif [ $day_short == "Wed" ]; then d="Wednesday" elif [ $day_short == "Thu" ]; then d="Thursday" elif [ $day_short == "Fri" ]; then d="Friday" elif [ $day_short == "Sat" ]; then d="Saturday" elif [ $day_short == "Sun" ]; then d="Sunday" fi echo Hi Mr $name today is $d