Sponsored Content
Top Forums Shell Programming and Scripting Using grep or something similar to invert search. Post 302785269 by PikK45 on Monday 25th of March 2013 07:32:44 AM
Old 03-25-2013
in that case egrep should help.

Code:
egrep -v "sent to primary BE|CC-Request-Type 3 received in state Idle|Unknown session-id. Origin-Host" /var/adm/messages* | wc -l

This User Gave Thanks to PikK45 For This Post:
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Printing the invert of the last field of awk

in csh set x = "/home/usr/dir1/file1" if i do: echo $x | awk -F\/ '{print $NF}' will result to: "file1" how do i invert the output to: "/home/usr/dir1" :confused: (2 Replies)
Discussion started by: jehrome_rando
2 Replies

2. UNIX for Dummies Questions & Answers

what is the similar command for "grep -v" in nawk?

Can any one please say about the below, using, grep -v "name" file.txt the result of above command will be it will print all the lines except the line which having the word "name" similarly, nawk 'c-->0;$0~s{if(b)for(c=b+1;c>1;c--)print r;print;c=a}b{r=$0}' b=0 a=1 s="name" file.txt ... (7 Replies)
Discussion started by: prsam
7 Replies

3. Shell Programming and Scripting

Help in grep function or similar using awk

I have a list of id; for example: file 1 dfghd dfghe dfgey dfgeu I have another data file that contain this ids as headers; for ex. file2 >dfghd gfdgfddl;klfkld;ld;lgl;dld'l'dv >dfghe gkwhjhsgdjdjdjhjddj >dfgey jdkjfhdjhfdkjhfdkhkdk I wanted to compare file 1 and file 2... (1 Reply)
Discussion started by: Lucky Ali
1 Replies

4. Shell Programming and Scripting

Invert Matrix of Data - Perl

I have columnar data in arrays perl, Example - @a = (1,2,3); @array1 = (A,B,C); @array2 = (D,E,F); @array3 = (I,R,T); I want the data to be formatted and printed as 1 A D I 2 B E F 3 C F T and so on... (8 Replies)
Discussion started by: dinjo_jo
8 Replies

5. Programming

How to invert order in QuickSort

Hello! Iam trying to reverse my order of quicksort in C from asc order (1-99) that is the original way of the algoritm, to descending (99-1). I've tried so many ways that iam a kind of lost now!:s The original quicksort is: void swap(int* a, int* B) { int tmp; tmp = *a; *a = *b; ... (1 Reply)
Discussion started by: rafazz
1 Replies

6. Shell Programming and Scripting

awk to search similar strings and add their values

Hi, I have a text file with the following content: monday,20 tuesday,10 wednesday,29 monday,10 friday,12 wednesday,14 monday,15 thursday,34 i want the following output: monday,45 tuesday,10 wednesday,43 friday,12 (3 Replies)
Discussion started by: prashu_g
3 Replies

7. Shell Programming and Scripting

awk to search similar strings and arrange in a specified pattern

Hi, I'm running a DB query which returns names of people and writes it in a text file as shown below: Carey, Jim; Cena, John Cena, John Sen, Tim; Burt, Terrence Lock, Jessey; Carey, Jim Norris, Chuck; Lee, Bruce Rock, Dwayne; Lee, Bruce I want to use awk and get all the names... (9 Replies)
Discussion started by: prashu_g
9 Replies

8. Shell Programming and Scripting

To search for a particular tag in xml and collate all similar tag values and display them count

I want to basically do the below thing. Suppose there is a tag called object1. I want to display an output for all similar tag values under heading of Object 1 and the count of the xmls. Please help File: <xml><object1>house</object1><object2>child</object2>... (9 Replies)
Discussion started by: srkmish
9 Replies

9. UNIX for Beginners Questions & Answers

How to use a grep search to search for a specific string within multiple directories?

Lets say I have a massive directory which is filled with other directories all filled with different c++ scripts and I want a listing of all the scripts that contain the string: "this string". Is there a way to use a grep search for that? I tried: grep -lr "this string" * but I do not... (3 Replies)
Discussion started by: Circuits
3 Replies
llconvert(8)						      System Manager's Manual						      llconvert(8)

NAME
llconvert - Modify lastlog records from DIGITAL UNIX releases 4.0x and prior to new format SYNOPSIS
/usr/lbin/llconvert [-vnrp?h] input_file [output_file] OPTIONS
Restore new format to old format. Verbose. Display lines while converting. Do not preserve contents of input file. Formatted print only. Do not convert. (May be used with the -r option). Display usage message. DESCRIPTION
The llconvert command reads records from the lastlog file, such as /var/adm/lastlog, and converts the record format to the updated struct lastlog format. If no output file is specified or if the output file path is identical to the input file path, llconvert makes a backup copy of the original input file using the following algorithm: If filename.orig exists. Where n is a unique number. The llconvert command attempts to detect an input file that is in the wrong format (for example, input file is already a new format file). A warning message is issued in this case, but conversion continues. RETURN VALUES
Success. An error occurred. EXAMPLES
To convert an old format accounting file to the new format: llconvert /var/adm/lastlog.prev Upon completion of this command, /var/adm/lastlog.prev will have been converted to the new format. The original /var/adm/last- log.prev is renamed to: /var/adm/lastlog.prev.orig To convert a lastlog file in new format to the old format: llconvert -r /var/adm/lastlog /var/adm/last- log.old FILES
Lastlog header file that defines the format for the lastlog file. The active lastlog file. SEE ALSO
Commands: finger(1) llconvert(8)
All times are GMT -4. The time now is 01:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy