Sponsored Content
Top Forums Shell Programming and Scripting Menu / Log files - reading / display Post 302397985 by xgringo on Tuesday 23rd of February 2010 05:30:00 PM
Old 02-23-2010
Something like this?

Code:
PS3="Select which log files you would like to search ? "

read myvar

select logfile in LogA LogB LogC LogD

do 
    cat /var/logA | grep "$logfile" | grep "$myvar"
    break
done



---------- Post updated at 03:26 PM ---------- Previous update was at 01:39 PM ----------

think I'm close? Help anyone?
Code:
#!/bin/ksh
#set -xv
PS3="Select which log files you would like to search ?"
 
LogA="~/ci*.log"
LogB="~/s2010*"
LogC="~/C2010*"
LogD="~/D2010*"
 
"Please enter the file name or variable that you would like to search for ?"
read myvar
 
select logfile in LogA LogB LogC LogD
 
do
cat $PS3 | grep "$myvar"
break
done



---------- Post updated at 05:05 PM ---------- Previous update was at 03:26 PM ----------

What if I said please? - I know you all probably think I'm a moron Smilie but could use the help.... if anyone has a minute.

---------- Post updated at 05:30 PM ---------- Previous update was at 05:05 PM ----------

I tried this too but the output keeps going in a loop I enter the input and keep going back to the menu.
Code:
#!/bin/sh
set -xv
while true; do
 
cat <<ENDINPUT
 
Menu of Options
 
1. Search a  Logs
2. Search b  Logs
3. Search c  Logs
4. Search d  Logs
 
ENDINPUT
 
echo "Please enter your choice:"
read option
 
echo "Please enter your search variable:"
read myvar
 
case "$option" in
        1)
                #grep *$myvar* /loga/a*.log
                ;;
        2)
                echo test 2
                ;;
        3)
                echo test 3
                ;;
        4)
                exit
                ;;
        *)
                echo "Use 1, 2, 3, or 4"
                ;;
esac
 
done


Last edited by Scott; 02-23-2010 at 04:39 PM.. Reason: Code tags please...
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

creating a menu for recycling and permanently deleting files.

Trying to alias rm to move files to a hidden trash directory in the bash shell. I've tried to create this alias numberous ways and it's just not working. Here's what I've tried, anyone have any suggestions. alias rm='mv $* ~/.trash' alias rm= 'mv$* ~/.trash' things like that... I've also... (2 Replies)
Discussion started by: strmy_ngts
2 Replies

2. Solaris

Disabled keystroke at the log-in menu

Hello I am unable to enter my password because the OS does not respond to my keystrokes in the password field at the log-in menu, even though it does in the username field. I have no clue how to troubleshoot this. Please help me out. Thank you (11 Replies)
Discussion started by: dai2809
11 Replies

3. Shell Programming and Scripting

Display a menu on bottom right of screen

Hi, I have a menu of around 10 lines with options. I want to display it in bottom right corner of screen for better display. I can do it with clear screen. But I don't want to use it, because it will clear the existing text. After one choice from menu is executed, the menu should just place... (3 Replies)
Discussion started by: som.nitk
3 Replies

4. UNIX for Dummies Questions & Answers

write a program in c in unix that display the files(includ sub-direc and files within) in a sorted

the sorting is based on name of file, file size modification time stamps o f file it should dislay the output in the following format "." and ".." enteries should be ignored please give some idea how to do it (1 Reply)
Discussion started by: pappu kumar jha
1 Replies

5. UNIX for Dummies Questions & Answers

Need Help in reading N days files from a Directory & combining the files

Hi All, Request your expertise in tackling one requirement in my project,(i dont have much expertise in Shell Scripting). The requirement is as below, 1) We store the last run date of a process in a file. When the batch run the next time, it should read this file, get the last run date from... (1 Reply)
Discussion started by: dsfreddie
1 Replies

6. Shell Programming and Scripting

Need help in create menu with 3 sub menu using the case command

hi all i am a newbie to this is there any examples on creating a main menu with 3 sub menu main menu -> option a , b and c a menu -> option 1 ,2 and 3 b menu -> option 1 ,2 c menu -> option 1 ,2 i am getting headache as my code kept getting unexpected EOF ---------- Post... (0 Replies)
Discussion started by: chercm
0 Replies

7. Shell Programming and Scripting

Display user selction from bash menu

I am trying to display the text the user selects from a bash menu. The below will display the menu and allow the user to enter a number, but will not display the choice selected. bash while true do printf "\n please make a selection from the MENU \n ... (4 Replies)
Discussion started by: cmccabe
4 Replies

8. Shell Programming and Scripting

Building a dynamic UNIX menu with input files

Hi! I am looking to build dynamic menu (named: lookup.sh) that reads a pipe delimited file for input. for example, contents of input.txt could be: user1|srv1 user3|srv1 user4|srv1 user2|srv2 I want the menu look like: 1) get password for user1 on srv1 2) get password for user3 on... (7 Replies)
Discussion started by: cpolikowsky
7 Replies

9. UNIX for Beginners Questions & Answers

Gnome 3.28.3 menu item dissapears under the system menu

I installed CentOS 8 with Gnome 3.28.2 and I noticed that the "switch user" menu item disappeared from under the system menu of Gnome classic (Both X11 & Wayland). I checked google and this problem seems to have a history going back several releases of Gnome. Unfortunately, I never found a... (1 Reply)
Discussion started by: bodisha
1 Replies
SVK::Log::ChangedPaths(3)				User Contributed Perl Documentation				 SVK::Log::ChangedPaths(3)

NAME
SVK::Log::ChangedPaths - partly lazy list of SVK::Log::ChangedPath objects SYNOPSIS
use SVK::Log::ChangedPaths; my $changed_paths = SVK::Log::ChangedPaths->new( $root ); for my $changed_path ( $changed_paths->paths() ) { ... } DESCRIPTION
An object of this class represents a collection of details about the files/directories that were changed in a particular revision. Some log filters want access to information about which paths were affected during a certain revision and others don't. Using this object allows the calculation of path details to be postponed until it's truly needed. METHODS
new Accepts the return value of "SVK::Path->root()" as a parameter and constructs a SVK::Log::ChangedPaths object from it. paths Returns a list of SVK::Log::ChangedPath objects each of which represents the details of the changes to a particular path. DIAGNOSTICS
None CONFIGURATION AND ENVIRONMENT
SVK::Log::ChangedPaths requires no configuration files or environment variables. DEPENDENCIES
o SVK::Log::ChangedPath INCOMPATIBILITIES
None known BUGS AND LIMITATIONS
None known perl v5.10.0 2008-08-04 SVK::Log::ChangedPaths(3)
All times are GMT -4. The time now is 04:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy