I'm almost there! But I need some more help with this!
I need to make the #2 option in the menu work. Using the find and more commands. Where [n] is the value of the user input. I ALSO NEED TO ADD A PEICE OF CODE THAT WILL ECHO "Invalid Option - Please choose another option" This is what I have so far.....
# this is the GENERIC UTILITIES menu
t=$(date "+%H:%S:%M")
c=$(tput rmso)
dd=$(date "+%b %d %Y")
b=$(tput bold)
while true
do
tput clear
cat << MENU
$LOGNAME GENERIC UTILITIES date - ${b}${dd}${c}
1. ${b}U${c}ser Information?
2. ${b}F${c}ind files older than [n] days
3. ${b}E${c}xit to sub-shell
4. ${b}Q${c}uit menu
User Selection: at ${b}${t}${c}
MENU
tput cup 20 15
read ans
case $ans in
1|U|u) # showuserinfo - print info about user from /etc/passwd and the
#/etc/group
IFS=":" # sets the field seperator to a colon
set -- $(grep $LOGNAME /etc/passwd)
echo "User=[$1] user#=[$3] group#=[$4]"
IFS=":"
set -- $(grep $4 /etc/group)
echo "grp name=[$1] members=[$4]
Press ENTER to continue"
read ans1
;;
2|F|f) #finding files older than n days using-
#the find and more commands
#echo "How many day's old?[n]"
#find *.* (???THIS IS WHERE I'M HAVING TROUBLE??)|more
#echo "Please press ENTER to continue"
;;
3|E|e) bash; continue
;;
4|Q|q) exit
;;
esac
done
|