05-27-2008
Problem with search pattern
Can anyone help me in a scriptfor below example which has to find the string "System && Passcode 0" or "System && Failcode ??"
If this searched string occurs consecutively 4 times it should provide output as error
S.No : Program: Status
1. was : Passcode 1
2. System: Passcode 0
3. System: Failcode 11
4. System : Failcode 12
5. war: Failcode 12
Last edited by gantagoru; 05-27-2008 at 08:10 AM..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am trying to do some thing like this ..
In a file , if pattern found insert new pattern at the begining of the line containing the pattern.
example:
in a file I have this.
gtrow0unit1/gctunit_crrownorth_stage5_outnet_feedthru_pin
if i find feedthru_pin want to insert !! at the... (7 Replies)
Discussion started by: pitagi
7 Replies
2. Shell Programming and Scripting
Hi all,
I am trying to extract the values ( text between the xml tags) based on the Order Number.
here is the sample input
<?xml version="1.0" encoding="UTF-8"?>
<NJCustomer>
<Header>
<MessageIdentifier>Y504173382</MessageIdentifier>
... (13 Replies)
Discussion started by: oky
13 Replies
3. Shell Programming and Scripting
Learning, stumbling! My progress in shell scripting is slow. Now I have this doubt:
I have the following file (users.txt):
AU0909,on
AU0309,off
AU0209,on
AU0109,off
And this file (userson.txt)
AU0909
AU0209
AU0109
AU0309
I just want to set those users on userson.txt to "off" in... (14 Replies)
Discussion started by: quinestor
14 Replies
4. Shell Programming and Scripting
i need to search for a pattern from a big file and print everything expect the next 6 lines from where the pattern match was made. (8 Replies)
Discussion started by: chidori
8 Replies
5. Shell Programming and Scripting
Hello Guyz
I have been following this forum for a while and the solutions provided are super useful. I currently have a scenario where i need to search for a pattern and start searching by keeping the first pattern as a baseline
ABC
DEF
LMN
EFG
HIJ
LMN
OPQ
In the above text i need to... (8 Replies)
Discussion started by: RickCharles
8 Replies
6. Shell Programming and Scripting
I am trying to search a file for a patterns ERR- in a file and return a count for each of the error reported
Input file is a free flowing file without any format
example of output
ERR-00001=5
....
ERR-01010=10
.....
ERR-99999=10 (4 Replies)
Discussion started by: swayam123
4 Replies
7. Shell Programming and Scripting
I have something like this:
bash-3.2$ svn info
Path: .
URL: svn+ssh://nlaedev01@10.209.194.15/files0/nlae_dev_svn/repos/newlook-endeca/trunk
Repository Root: svn+ssh://nlaedev01@10.209.194.15/files0/nlae_dev_svn/repos/newlook-endeca
Repository UUID: 4e8fbe85-c2e2-42fe-a5fa-f9f9100d2393... (3 Replies)
Discussion started by: ankur328
3 Replies
8. Shell Programming and Scripting
Hi,
I have two files file1.txt and file2.txt. Please see the attachments.
In file2.txt (which actually is a diff output between two versions of file1.txt.), I extract the pattern corresponding to 1172c1172. Now ,In file1.txt I have to search for this pattern 1172c1172 and if found, I have to... (9 Replies)
Discussion started by: saurabh kumar
9 Replies
9. Shell Programming and Scripting
Hi,
I've written a script to search for an Oracle ORA- error on a log file, print that line and the .trc file associated with it as well as the dateline of when I assumed the error occured. In most it is the first dateline previous to the error.
Unfortunately, this is not a fool proof script.... (2 Replies)
Discussion started by: newbie_01
2 Replies
10. UNIX for Beginners Questions & Answers
I have this fileA
TEST FILE ABC
this file contains ABC;
TEST FILE DGHT this file contains DGHT;
TEST FILE 123
this file contains ABC,
this file contains DEF,
this file contains XYZ,
this file contains KLM
;
I want to have a fileZ that has only (begin search pattern for will be... (2 Replies)
Discussion started by: vbabz
2 Replies
cd_suf(3) Library Functions Manual cd_suf(3)
NAME
cd_suf - Read System Use Field from a specified System Use Area on a Rock Ridge format CD-ROM
LIBRARY
CD-ROM library (libcdrom.so, libcdrom.a)
SYNOPSIS
#include <sys/cdrom.h>
int cd_suf (path, fsec, signature, index, buf, buflen)
char *path;
int fsec;
char signature[2];
int index;
char *buf;
int buflen;
DESCRIPTION
Returns a System Use Field in the System Use Area for path. Points to a file or directory within the CD-ROM file hierarchy. Specifies the
File Section of that file. The numbering starts with one. If fsec is set to -1, the System Use Area of the last File Section of that file
is assumed. The 2-byte signature to look for and return from the System Use Area. The occurrence of signature to return. If signature is
a NULL pointer, returns the System Use Field specified by index starting from the beginning of the System Use Area. Otherwise, returns the
occurrence of signature specified by index. The index number of the first System Use Field of any signature is one. The buffer in which to
place the System Use Field. The buffer length of buf.
RETURN VALUES
The cd_suf function will return the number of bytes placed in buf if successful. The cd_suf function will return 0 if the signature field
is not found. In case of error, -1 is returned and errno is set to indicate the error.
ERRORS
The cd_suf() function will fail if: Search permission is denied for a component of the path prefix or read permission on the file or direc-
tory pointed to by path is denied. The length of the path string exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}
while {_POSIX_NO_TRUNC} is in effect. A component of path does not exist or the path argument points to an empty string. The File Section
indicated by fsec has no System Use Area. A component of the path prefix is not a directory. The address of buf, signature, or path is
invalid. The value of fsec, index, or buflen is invalid. The argument path points to a file or directory not within a CD-ROM file hierar-
chy. The Volume containing the File Section indicated by fsec is not mounted. The CD-ROM is not in the drive or a read error occurred. A
signal was caught during the cd_suf() function. {OPEN_MAX} file descriptors are currently open in the calling process.
[Tru64 UNIX] Either the OPEN_MAX value or the per-process soft descriptor limit is checked. The system file table is full.
RELATED INFORMATION
Commands: cdsuf(1)
Files: <sys/cdrom.h> delim off
cd_suf(3)