Sponsored Content
Full Discussion: pattern list?
Top Forums UNIX for Dummies Questions & Answers pattern list? Post 2112 by 98_1LE on Friday 20th of April 2001 08:55:30 AM
Old 04-20-2001
Use egrep
Code:
egrep timing\|dochar | wc -l

\| is used to sperate multiple search strings
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Korn pattern-list with a variable

I am trying to use a pattern-list match in korn shell using a variable and it always seems to regard the pattern-list as a literal: Using the directory names explicitly in the pattern-list works fine: ls @(test|test1)/test.txt and returns: test/test.txt Trying to use a variable for this... (2 Replies)
Discussion started by: partchimp
2 Replies

2. UNIX and Linux Applications

Need to list pattern only not containing whole line

I am searching a pattern item_id>000111111</item_id> in an XML file. More than one occurance are there for this patter in a single line. I have tried awk '/item_id/,/item_id/' tpnb1.txt>abc.txt Full lines containg pattern are coming. I need only list of 000111111. (1 Reply)
Discussion started by: tredev
1 Replies

3. Shell Programming and Scripting

using sed to replace a pattern in list of files

Hi All, using the below grep command,I get the following output: $grep -irl "bc" /home/applmgr/amit > file_list.log $cat file_list.log /home/applmgr/amit/xyz.log /home/applmgr/amit/abc.log Requirement ========= Need sed utility to replace "bc" with "xy" pattern in the list of files... (4 Replies)
Discussion started by: a1_win
4 Replies

4. Shell Programming and Scripting

how to list files with certain pattern

Hi I have files in the following naming convention, for example, /t1/bin/asrv270 /t1/bin/asrv270.sav /t1/bin/asrv2392.px2392.has_been_deleted.sav /t1/bin/asrv2713.sav.sav etc... The number after "asrv" is different. I need to list only the files which end up with the number, for example, ... (2 Replies)
Discussion started by: aoussenko
2 Replies

5. UNIX for Advanced & Expert Users

Unix: list out Pattern occurrence (count)

Need to search a pattern occurrence (count) in a specified file. Below is the details $ cat fruits apple apple ball ball apple ball ball ball apple apple apple cat cat cat cat cat apple apple Note: If I'll use the grep command with -c option then it'll count the 1st occurrence in... (6 Replies)
Discussion started by: tp2115
6 Replies

6. Shell Programming and Scripting

list files with a specific pattern

How can I list files with the following specific criteria? I am trying this $> ls *.log or $>ls *.log? --> but it only gives me fsaffa.log1, rwerw.log2. How can I get all three files with a simple selection criteria ? (5 Replies)
Discussion started by: kchinnam
5 Replies

7. UNIX for Dummies Questions & Answers

List only files based on a pattern

Hi Gurus, I need to list only the files with out certain extension. For eg from the following list of files: I need to only list: Thanks Shash (7 Replies)
Discussion started by: shash
7 Replies

8. Shell Programming and Scripting

Pattern list to remove from other file

I have fileA: Joey.smith /my/path/to/here here bill@smith /my/path/to/there there John@smith /my/path/to/anywhere anywhereI have fileB: bill@smithI want to end with fileC: Joey.smith /my/path/to/here here John@smith /my/path/to/anywhere anywhereThus remove B from A, the whole line. I've... (3 Replies)
Discussion started by: crowman
3 Replies

9. Linux

Search multiple pattern from list

I am working on AIX operating system. I want to search list of Article Id for given Set Date (which are present in a seperate file input.txt) art_list.csv ------------ "Article ID" |"Ad Description" |"Pyramid"|"Pyramid Desc "|"ProductTypeId"|"Set Date "|... (3 Replies)
Discussion started by: rajivrsk
3 Replies

10. Shell Programming and Scripting

Need help with pattern matching to list missing packages

I have wrote this small program to check for installed and missing packages in LINUX (RHEL x86_64) For now it perfectly prints all the installed and missing packages however I want that it loops through to the end (in either case) and list all packages however if one or more packages are... (5 Replies)
Discussion started by: Dazzler74
5 Replies
ZIPGREP(1L)															       ZIPGREP(1L)

NAME
zipgrep - search files in a ZIP archive for lines matching a pattern SYNOPSIS
zipgrep [egrep_options] pattern file[.zip] [file(s) ...] [-x xfile(s) ...] DESCRIPTION
zipgrep will search files within a ZIP archive for lines matching the given string or pattern. zipgrep is a shell script and requires egrep(1) and unzip(1L) to function. Its output is identical to that of egrep(1). ARGUMENTS
pattern The pattern to be located within a ZIP archive. Any string or regular expression accepted by egrep(1) may be used. file[.zip] Path of the ZIP archive. (Wildcard expressions for the ZIP archive name are not supported.) If the literal filename is not found, the suffix .zip is appended. Note that self-extracting ZIP files are supported, as with any other ZIP archive; just specify the .exe suffix (if any) explicitly. [file(s)] An optional list of archive members to be processed, separated by spaces. If no member files are specified, all members of the ZIP archive are searched. Regular expressions (wildcards) may be used to match multiple members: * matches a sequence of 0 or more characters ? matches exactly 1 character [...] matches any single character found inside the brackets; ranges are specified by a beginning character, a hyphen, and an end- ing character. If an exclamation point or a caret (`!' or `^') follows the left bracket, then the range of characters within the brackets is complemented (that is, anything except the characters inside the brackets is considered a match). (Be sure to quote any character that might otherwise be interpreted or modified by the operating system.) [-x xfile(s)] An optional list of archive members to be excluded from processing. Since wildcard characters match directory separators (`/'), this option may be used to exclude any files that are in subdirectories. For example, ``zipgrep grumpy foo *.[ch] -x */*'' would search for the string ``grumpy'' in all C source files in the main directory of the ``foo'' archive, but none in any subdirectories. Without the -x option, all C source files in all directories within the zipfile would be searched. OPTIONS
All options prior to the ZIP archive filename are passed to egrep(1). SEE ALSO
egrep(1), unzip(1L), zip(1L), funzip(1L), zipcloak(1L), zipinfo(1L), zipnote(1L), zipsplit(1L) URL
The Info-ZIP home page is currently at http://www.info-zip.org/pub/infozip/ or ftp://ftp.info-zip.org/pub/infozip/ . AUTHORS
zipgrep was written by Jean-loup Gailly. Info-ZIP 20 April 2009 ZIPGREP(1L)
All times are GMT -4. The time now is 12:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy