Sponsored Content
Top Forums UNIX for Dummies Questions & Answers script to search patterns inside list of files Post 302463837 by DGPickett on Monday 18th of October 2010 02:39:21 PM
Old 10-18-2010
If th list is not too big, this does both patterns in one pass:
Code:
grep -El '(abc|xyz)\.dml' $(< list_of_files )

else this does any length list:
Code:
xargs -n 101 grep -El "'(abc|xyz)\\.dml'" < list_of_files

and there are ways, a bit more complex, to run N grep processes in parallel. Getting the output back together and limiting the parallel number to N is messy to script.
 

10 More Discussions You Might Find Interesting

1. UNIX Desktop Questions & Answers

how to search files efficiently using patterns

hi friens, :) if i need to find files with extension .c++,.C++,.cpp,.Cpp,.CPp,.cPP,.CpP,.cpP,.c,.C wat is the pattern for finding them :confused: (2 Replies)
Discussion started by: arunsubbhian
2 Replies

2. Shell Programming and Scripting

Using a script variable in awk search patterns

Hi all, In a script like : job_date=.... ls -l 2>/dev/null | awk -v var =$job_date ' /Name\.Version\.+\.xml$/ { How can i include a script variable job_date store in "var" in the pattern "/Name\.Version\.+\.xml$/" Thanks in advance (12 Replies)
Discussion started by: abhinav192
12 Replies

3. UNIX for Advanced & Expert Users

Best way to search for patterns in huge text files

I have the following situation: a text file with 50000 string patterns: abc2344536 gvk6575556 klo6575556 .... and 3 text files each with more than 1 million lines: ... 000000 abc2344536 46575 0000 000000 abc2344536 46575 4444 000000 abc2344555 46575 1234 ... I... (8 Replies)
Discussion started by: andy2000
8 Replies

4. Shell Programming and Scripting

to read two files, search for patterns and store the output in third file

hello i have two files temp.txt and temp_unique.text the second file consists the unique fields from the temp.txt file the strings stored are in the following form 4,4 17,12 15,65 4,4 14,41 15,65 65,89 1254,1298i'm able to run the following script to get the total count of a... (3 Replies)
Discussion started by: vaibhavkorde
3 Replies

5. SuSE

Search all files based on first and in all listed files search the second patterns

Hello Linux Masters, I am not a linux expert therefore i need help from linux gurus. Well i have a requirement where i need to search all files based on first patterns and after seraching all files then serach second pattern in all files which i have extracted based on first pattern.... (1 Reply)
Discussion started by: Black-Linux
1 Replies

6. Programming

Is it possible to change search inside .pdf or .doc files?

the titele was wrong ... the true one is: Is it possible to search words inside .pdf or .doc files? is it possible if i changed the word into binary combination:eek:? and this way is super too hyper huge of greatest codes i ever seen:D to read only 1 word so is there any other ways:confused:? ... (1 Reply)
Discussion started by: fwrlfo
1 Replies

7. Shell Programming and Scripting

Search for patterns in thousands of files

Hi All, I want to search for a certain string in thousands of files and these files are distributed over different directories created daily. For that I created a small script in bash but while running it I am getting the below error: /ms.sh: xrealloc: subst.c:5173: cannot allocate... (17 Replies)
Discussion started by: danish0909
17 Replies

8. UNIX for Dummies Questions & Answers

[Solved] List Files With Multiple Name Patterns

Hi, We have created a script that would accept the an indicator as a parameter and archive files present in a directory. The indicator would drive what the name pattern of the files to be archived should be. If the indicator is 1, then the pattern to look out for is FACT*. If the indicator is... (2 Replies)
Discussion started by: jerome_rajan
2 Replies

9. Shell Programming and Scripting

Search and replace multiple patterns in a particular column only - efficient script

Hi Bigshots, I have a pattern file with two columns. I have another data file. If column 1 in the pattern file appears as the 4th column in the data file, I need to replace it (4th column of data file) with column 2 of the pattern file. If the pattern is found in any other column, it should not... (6 Replies)
Discussion started by: ss112233
6 Replies

10. Programming

Search or find a element inside list python

I have a list as follows: From this i need to grep the element using keyword as "primary" and return output as 12:13-internet-wifi-primary i used as follows if (i <= (len(system_info))): ss = system_info print... (5 Replies)
Discussion started by: Priya Amaresh
5 Replies
sigtool(1)							  Clam AntiVirus							sigtool(1)

NAME
sigtool - signature and database management tool SYNOPSIS
sigtool [options] DESCRIPTION
sigtool can be used to generate MD5 checksums, convert data into hexadecimal format, list virus signatures and build/unpack/test/verify CVD databases and update scripts. OPTIONS
-h, --help Output help information and exit. -V, --version Print version number and exit. --quiet Be quiet - output only error messages. --stdout Write all messages to stdout. --hex-dump Read data from stdin and write hex string to stdout. --md5 [FILES] Generate MD5 checksum from stdin or MD5 sigs for FILES. --sha1 [FILES] Generate SHA1 checksum from stdin or SHA1 sigs for FILES. --sha256 [FILES] Generate SHA256 checksum from stdin or SHA256 sigs for FILES. --mdb [FILES] Generate .mdb signatures for FILES. --html-normalise=FILE Create normalised HTML files comment.html, nocomment.html, and script.html in current working directory. --utf16-decode=FILE Decode UTF16 encoded data. --vba=FILE Extract VBA/Word6 macros from given MS Office document. --vba-hex=FILE Extract Word6 macros from given MS Office document and display the corresponding hex values. -i, --info Print a CVD information and verify MD5 and a digital signature. -b, --build Build a CVD file. -s, --server is required. --max-bad-sigs=NUMBER Maximum number of mismatched signatures when building a CVD. Default: 3000 --flevel Specify a custom flevel. Default: 77 --cvd-version Specify the version number to use for the build. Default is to use the value+1 from the current CVD in --datadir. If no datafile is found the default behaviour is to prompt for a version number, this switch will prevent the prompt. NOTE: If a CVD is found in the --datadir its version+1 is used and this value is ignored. --no-cdiff Don't create a .cdiff file when building a new database file. --unsigned Create a database file without digital signatures (.cua). --server ClamAV Signing Service address (for virus database maintainers only). --datadir=DIR Use DIR as the default database directory for all operations. --unpack=FILE, -u FILE Unpack FILE (CVD) to a current directory. --unpack-current Unpack a local CVD file (main or daily) to current directory. --diff=OLD NEW, -d OLD NEW Create a diff file for OLD and NEW CVDs/INCDIRs. --compare=OLD NEW, -c OLD NEW This command will compare two text files and print differences in a cdiff format. --run-cdiff=FILE, -r FILE Execute update script FILE in current directory. --verify-cdiff=FILE, -r FILE Verify DIFF against CVD/INCDIR. -l[FILE], --list-sigs[=FILE] List all signature names from the local database directory (default) or from FILE. -fREGEX, --find-sigs=REGEX Find and display signatures from the local database directory which match the given REGEX. The whole signature body (name, hex string, etc.) is checked. --decode-sigs=REGEX Decode signatures read from the standard input (eg. piped from --find-sigs) --test-sigs=DATABASE TARGET_FILE Test all signatures from DATABASE against TARGET_FILE. This option will only give valid results if the target file is the final one (after unpacking, normalization, etc.) for which the signatures were created. --print-certs=FILE Print Authenticode details from a PE file. EXAMPLES
Generate hex string from testfile and save it to testfile.hex: cat testfile | sigtool --hex-dump > testfile.hex CREDITS
Please check the full documentation for credits. AUTHOR
Tomasz Kojm <tkojm@clamav.net> SEE ALSO
freshclam(1), freshclam.conf(5) ClamAV 0.98.4 February 12, 2007 sigtool(1)
All times are GMT -4. The time now is 05:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy