Sponsored Content
Full Discussion: Grep with unknown pattern?
Top Forums Shell Programming and Scripting Grep with unknown pattern? Post 302753705 by Morridini on Wednesday 9th of January 2013 08:31:04 AM
Old 01-09-2013
Thanks, that worked like a charm.

And doubly thanks for explaining all the terms rather than giving me a solution (that looks really complicated at first glance).
 

10 More Discussions You Might Find Interesting

1. Solaris

PING - Unknown host 127.0.0.1, Unknown host localhost - Solaris 10

Hello, I have a problem - I created a chrooted jail for one user. When I'm logged in as root, everything work fine, but when I'm logged in as a chrooted user - I have many problems: 1. When I execute the command ping, I get weird results: bash-3.00$ usr/sbin/ping localhost ... (4 Replies)
Discussion started by: Przemek
4 Replies

2. Shell Programming and Scripting

Grep to match unknown pattern

Hi there I would like to search a file for a certain pattern, but i don't know the exact pattern i need to search for. What i do know is that i need to search for the pattern that exists the most in a certain file. so if a file looksike this: summer, summer, winter, spring, summer... (4 Replies)
Discussion started by: mrchilly
4 Replies

3. Shell Programming and Scripting

Want to grep for a pattern and display the content above that pattern

Hi, When we have a failure, sometimes we just step restart the job from the next step. Later when we open the log for analysis of the failure, it is becoming difficult to go to the failure part. For eg., if it is a 1000 line log, the failure may be at 500th line. so wat i want to do is, grep... (6 Replies)
Discussion started by: ajayakunuri
6 Replies

4. UNIX for Dummies Questions & Answers

Replace line with found unknown pattern

Hi, I have a file with the following content: --------- a 3242 tc_5 gdfg4 random text a 3242 tc_6 gdfg4 random text a 3242 tc_7 gdfg4 random text a 3242 tc_4 gdfg4 --------- I want to replace the lines containing tc_? (tc_5, tc_6 etc. even with unknown numbers) with the found... (5 Replies)
Discussion started by: joas
5 Replies

5. Shell Programming and Scripting

grep unknown number of params

Hey i got trivial question but i cant figure it out. I want to grep a file for multiple unknown parameters. The user will enter these parameters at the command line. For example... ./program red apple filename This would grep for the phrase red apple. But i cant just do $1 $2 because the... (8 Replies)
Discussion started by: GmGeubt
8 Replies

6. Shell Programming and Scripting

Grep the word from pattern line and update in subsequent lines till next pattern line reached

Hi, I have got the below requirement. please suggest. I have a file like, Processing Item is: /data/ing/cfg2/abc.txt /data/ing/cfg3/bgc.txt Processing Item is: /data/cmd/for2/ght.txt /data/kernal/config.klgt.txt I want to process the above file to get the output file like, ... (5 Replies)
Discussion started by: rbalaj16
5 Replies

7. Shell Programming and Scripting

How to Grep than scan line below grep pattern

Hello Colleagues, I have a file that looks like below. 6-12731913-12731913 9230760143480 410018547148230 20131002193434+0500 20131002193434+0500 ;20131002T161031000-10.50.241.21-21912131-1419034760, ver: 0 20131009 92220056296730 CC0P abc Core_Context_R1A SMS 6-12726796-12726796... (14 Replies)
Discussion started by: umarsatti
14 Replies

8. Shell Programming and Scripting

sed and awk usage to grep a pattern 1 and with reference to this grep a pattern 2 and pattern 3

Hi , I have a file where i have modifed certain things compared to original file . The difference of the original file and modified file is as follows. # diff mir_lex.c.modified mir_lex.c.orig 3209c3209 < if(yy_current_buffer -> yy_is_our_buffer == 0) { --- >... (5 Replies)
Discussion started by: breezevinay
5 Replies

9. Shell Programming and Scripting

Grep lines before a pattern having some other pattern

Hi All, I am trying to fetch lines before a pattern, I got to know about -B flag in grep but we have to pass the number to get those lines before some pattern say (X), now what if I want to get line/s with some other pattern say (Y) before X pattern? How to get about it? please help. Input:... (5 Replies)
Discussion started by: dips_ag
5 Replies

10. UNIX for Dummies Questions & Answers

Grep -v lines starting with pattern 1 and not matching pattern 2

Hi all! Thanks for taking the time to view this! I want to grep out all lines of a file that starts with pattern 1 but also does not match with the second pattern. Example: Drink a soda Eat a banana Eat multiple bananas Drink an apple juice Eat an apple Eat multiple apples I... (8 Replies)
Discussion started by: demmel
8 Replies
LOCATE.CONF(5)						      BSD File Formats Manual						    LOCATE.CONF(5)

NAME
locate.conf -- locate database configuration file DESCRIPTION
The locate.conf file specifies the behavior of locate.updatedb(8), which creates the locate(1) database. The locate.conf file contains a list of newline separated records, each of which is composed of a keyword and arguments, which are separated by white space. Arguments with embedded shell metacharacters must be quoted in sh(1) style. Lines beginning with ``#'' are treated as com- ments and ignored. However, a ``#'' in the middle of a line does not start a comment. The configuration options are as follows: ignore pattern ... Ignore files or directories. When building the database, do not descend into files or directories which match one of the specified patterns. The matched files or directories are not stored to the database. Default: Not specified. ignorecontents pattern ... Ignore contents of directories. When building the database, do not descend into files or directories which match one of the speci- fied patterns. The matched files or directories themselves are stored to the database. Default: Not specified. ignorefs type ... Ignore file system by type, adding type to the default list. When building the database, do not descend into file systems which are of the specified type. The mount points are not stored to the database. If a ``!'' is prepended to type, the meaning is negated, that is, ignore file systems which do not have the type. As a special case, if ``none'' is specified for type, the ignorefs list is cleared and all file systems are traversed. type is used as an argument to find(1) -fstype. The sysctl(8) command can be used to find out the types of file systems that are available on the system: sysctl vfs.generic.fstypes Default: !local cd9660 fdesc kernfs procfs searchpath directory ... Specify base directories to be put in the database. Default: / workdir directory Specify the working directory of locate.updatedb, in which a temporary file is placed. The temporary file is a list of all files, and you should specify a directory that has enough space to hold it. Default: /tmp Refer to find(1) for the details of pattern (see -path expression) and type (see -fstype expression). FILES
/etc/locate.conf The file locate.conf resides in /etc. SEE ALSO
find(1), locate(1), locate.updatedb(8), sysctl(8) HISTORY
The locate.conf file format first appeared in NetBSD 2.0. AUTHORS
ITOH Yasufumi BSD
July 10, 2011 BSD
All times are GMT -4. The time now is 12:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy