LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-01-2001, 10:20 AM   #1
clarkebar
LQ Newbie
 
Registered: May 2001
Posts: 5

Rep: Reputation: 0

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

 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting sLoPPy cASE to Pretty Case with tr lowpro2k3 Programming 4 04-13-2005 08:13 PM
Why are all my upper case files being shown as lower case?? [Kernel 2.6.9-1.667 FC3] t3gah Fedora 4 03-11-2005 04:09 PM
Lower case to upper case letter sudhasmyle Programming 1 12-03-2004 04:15 AM
Case Study For Linux OS varunbihani Linux - General 3 11-08-2003 02:51 AM
Need help with Linux Case Study !!!!! Just a few questions!! clarkebar Programming 3 06-01-2001 08:54 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration