I fully second RavinderSingh13 saying that your specifications could be WAY clearer and more precise FROM THE START. Amongst other incertainties, your output file names have been specified to be
- found1.tmp
- deploy_found1.tmp
- update.found1.tmp
- deploy.tmp_found1.tmp
- Input_file_found1.tmp (might be a variation of No. 2)
Wouldn't it save YOUR time, too, making up your mind first and then posting?
I have a script which searches a huge log file for the existence of a specified string and if the string is not present i receive an alert mail.
Here's an extract:
STRING=$(grep 'warning' logfile | tail -1 | wc -l)
if (( ${STRING} > 0 ));
then
print -- "---- Warning etc.... (3 Replies)
Hi,
Can any one pelase tell me how to grep multiple strings from multiple files in a singel folder?
grep -E "string1|string2|string3|string4|string..."
its taking lots of time..
can any please tell me fast grep???
URGENT (10 Replies)
Hi,
New to shell scripting....
I have log file content as below:
I have to count the number of occurences of ERROR or INFO Messages.
So, I cut 5 th column and uniquly sorted and redirected it to new.txt file.
But I want copy to S*/Filename and T*/Filename of respective ERROR or INFO... (5 Replies)
I want to search files (basically .cc files) in /xx folder and subfolders.
Those files (*.cc files) must contain #include "header.h" AND x() function.
I am writing it another way to make it clear,
I wanna list of *.cc files that have 'header.h' & 'x()'. They must have two strings, header.h... (2 Replies)
Hi,
I will use below command for grep single string ("osuser" is search string)
ex: find . -type f | xarg grep -il osuser
but i have one more string "v$session"
here i want to grep in which file these two strings are present.
any help is appreciated,
Thanks in advance.
Gagan (2 Replies)
Hi, every one!
I have a file with multiple strings.
file1
ATQRGNE
ASQGVKFTE
ASSQYRDRGGLET
SPEQGARSDE
ASSRDFTDT
ASSYSGGYE
ASSYTRLWNTGE
ASQGHNTD
PSLGGGNQPQH
SLDRDSYNEQF
I want to grep each string in hundreds of files in the same directory, further, I want to find out the string... (7 Replies)
I have a script that periodically checks the Apache error_log to search for a specific error that causes it to hand and, if found, it restarts the service.
I recently found another error that forces it to hand and won't serve pages until it is reset. What I'm trying to do is to get the script to... (3 Replies)
Hi,
Whether we can search multiple strings using or in grep -F
In Generally,
grep -F "string1" "filename.txt"
How to search for multiple string using grep -F as we using grep
grep "string1\|string2" "filename.txt"
Regards,
Nanthagopal A (10 Replies)
Consider i have the below data in my log file.
i want to grep using "Monday" and "Working"
So the only output i expect is
Can you help me with the grep query for Sun Sparc ?
Usage: grep -hblcnsviw pattern file . . . (8 Replies)
i search between two strings viz <app-deployment> & </app-deployment> and save the contents in a new file using the code snippet below.
sed -n "/<app-deployment/,/<\/app-deployment>/p" deploy.tmp >found1.tmpBut if the search string apprears more than once in the file then how can i store the... (3 Replies)
Discussion started by: mohtashims
3 Replies
LEARN ABOUT BSD
xstr
XSTR(1) General Commands Manual XSTR(1)NAME
xstr - extract strings from C programs to implement shared strings
SYNOPSIS
xstr [ -c ] [ - ] [ file ]
DESCRIPTION
Xstr maintains a file strings into which strings in component parts of a large program are hashed. These strings are replaced with refer-
ences to this common area. This serves to implement shared constant strings, most useful if they are also read-only.
The command
xstr -c name
will extract the strings from the C source in name, replacing string references by expressions of the form (&xstr[number]) for some number.
An appropriate declaration of xstr is prepended to the file. The resulting C text is placed in the file x.c, to then be compiled. The
strings from this file are placed in the strings data base if they are not there already. Repeated strings and strings which are suffices
of existing strings do not cause changes to the data base.
After all components of a large program have been compiled a file xs.c declaring the common xstr space can be created by a command of the
form
xstr
This xs.c file should then be compiled and loaded with the rest of the program. If possible, the array can be made read-only (shared) sav-
ing space and swap overhead.
Xstr can also be used on a single file. A command
xstr name
creates files x.c and xs.c as before, without using or affecting any strings file in the same directory.
It may be useful to run xstr after the C preprocessor if any macro definitions yield strings or if there is conditional code which contains
strings which may not, in fact, be needed. Xstr reads from its standard input when the argument `-' is given. An appropriate command
sequence for running xstr after the C preprocessor is:
cc -E name.c | xstr -c -
cc -c x.c
mv x.o name.o
Xstr does not touch the file strings unless new items are added, thus make can avoid remaking xs.o unless truly necessary.
FILES
strings Data base of strings
x.c Massaged C source
xs.c C source for definition of array `xstr'
/tmp/xs* Temp file when `xstr name' doesn't touch strings
SEE ALSO mkstr(1)BUGS
If a string is a suffix of another string in the data base, but the shorter string is seen first by xstr both strings will be placed in the
data base, when just placing the longer one there will do.
3rd Berkeley Distribution May 7, 1986 XSTR(1)