Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 06-01-2001, 10:20 AM   #1
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
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}
tput cup 20 15
read ans
case $ans in

1|U|u) # showuserinfo - print info about user from /etc/passwd and the
IFS=":" # sets the field seperator to a colon
set -- $(grep $LOGNAME /etc/passwd)
echo "User=[$1] user#=[$3] group#=[$4]"
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




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 > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:52 AM.

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