Sponsored Content
Full Discussion: prepare log for access
Top Forums Shell Programming and Scripting prepare log for access Post 39342 by criglerj on Wednesday 13th of August 2003 02:28:02 PM
Old 08-13-2003
Stuff like this reminds me why I don't use csh.Smilie Here's an awk solution. On Solaris, you have to use /usr/xpg4/bin/awk; FreeBSD 4.8 uses nawk (and perhaps awk, but on 4.8 awk is gawk, though that's changing in 5.x ...)
Code:
#!/usr/xpg4/bin/awk -f

$1 ~ /^[0-9]{4}(-[0-9]{2}){2}$/ {
        # If the first field looks like
        # a date, use it and the second field
        date = $1
        time = substr($2, 1, 8)
    }
index($0, eventname) {
        # Found the event name, so spit out the
        # name with the previously gathered date
        # and time
        split($0, a, ";")
        print date ";" time ";" a[1]
    }

Put this in a file (call it "scanlog", perhaps) and mark it executable. Then invoke it like this:
Code:
scanlog -v event=oltprogramm <losed >layer

The entire thing operates in a single pass over the file with a single process. Your solution creates 4 * n + 1 processes, where "n" is the number of events that matches your input pattern.
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to prepare HDD for Installation of Solaris

Hi All, I need some advice on dual booting a dell box so that I can have WinXP and Solaris 10 OS there. The question is, what is the best way of preparing the hdd for prior to installation? I have used created two partition, one for xp and the and the other unallocated partition for Solaris.... (3 Replies)
Discussion started by: S0laris_B0y
3 Replies

2. Shell Programming and Scripting

How can i prepare a file by comparing two other files?

File 1 data: TestA TestB TestC File 2 data: TestA TestD TestE My Output File (pick all from both and create a file without duplicate data) ---------------------------------------------------------------------- TestA TestB TestC (3 Replies)
Discussion started by: manmohanpv
3 Replies

3. UNIX for Dummies Questions & Answers

prepare a perl tuts

Hi I am working on perl for last 3 yrs and as part of knowledge sharing i have been told to conduct sessions with other teams.Only 1 session with basic details. My problem is i am not sure what all should i cover in this tut ? because i learned perl on my own. so i am not sure where to start... (4 Replies)
Discussion started by: zedex
4 Replies

4. Shell Programming and Scripting

Prepare command before executing

Hi, Couldnt find the right string" to search for a similar question..so dont know if this has been answered yet...problem is that I want to prepare a command with the requisite parameters passed as a string before executing it...eg: the ls command .. I can pass "-l", "-t" as parameters and... (12 Replies)
Discussion started by: harman_6
12 Replies

5. UNIX for Dummies Questions & Answers

prepare a tar package

I have installed apache2 on Solaris machine with the binary. So i dont want to install the same binary across all the systems but only want to copy the lib files and the files which have been updated in this installation process. So in order to get those lib files and then prepare a tar package... (5 Replies)
Discussion started by: prash358
5 Replies

6. Red Hat

Modprobe prepare new IP address

Hello, I m working on virtualization and saved the templates in virtual server. On creating the new Virtual machine or linux system, is there a way where during booting, it should prompt for new IP address, gateway, DNS and hostname? Or is there any configuration in linux where we can modify... (5 Replies)
Discussion started by: alnhk
5 Replies

7. Shell Programming and Scripting

Prepare file run report

I have a requirement to prepare a report. We validate some incoming data fields and create validation_error reports which will contain records which do not pass validation. Once files are processed they will all be dropped under one folder. EMPLOYEE_20140915.txt... (8 Replies)
Discussion started by: member2014
8 Replies

8. Shell Programming and Scripting

How can i prepare grant staement with 2 files ?

---file1 ( tables A B C D E F ... ... Z ---file2 Joe Bob Mary Sally Fred Elmer David (1 Reply)
Discussion started by: rocking77
1 Replies
ucblinks(1B)					     SunOS/BSD Compatibility Package Commands					      ucblinks(1B)

NAME
ucblinks - adds /dev entries to give SunOS 4.x compatible names to SunOS 5.x devices SYNOPSIS
/usr/ucb/ucblinks [-e rulebase] [-r rootdir] DESCRIPTION
ucblinks creates symbolic links under the /dev directory for devices whose SunOS 5.x names differ from their SunOS 4.x names. Where possi- ble, these symbolic links point to the device's SunOS 5.x name rather than to the actual /devices entry. ucblinks does not remove unneeded compatibility links; these must be removed by hand. ucblinks should be called each time the system is reconfiguration-booted, after any new SunOS 5.x links that are needed have been created, since the reconfiguration may have resulted in more compatibility names being needed. In releases prior to SunOS 5.4, ucblinks used a nawk rule-base to construct the SunOS 4.x compatible names. ucblinks no longer uses nawk for the default operation, although nawk rule-bases can still be specifed with the -e option. The nawk rule-base equivalent to the SunOS 5.4 default operation can be found in /usr/ucblib/ucblinks.awk. OPTIONS
-e rulebase Specify rulebase as the file containing nawk(1) pattern-action statements. -r rootdir Specify rootdir as the directory under which dev and devices will be found, rather than the standard root directory /. FILES
/usr/ucblib/ucblinks.awk sample rule-base for compatibility links ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWscpu | +-----------------------------+-----------------------------+ SEE ALSO
devlinks(1M), disks(1M), ports(1M), tapes(1M), attributes(5) SunOS 5.10 13 Apr 1994 ucblinks(1B)
All times are GMT -4. The time now is 04:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy