Sponsored Content
Top Forums Shell Programming and Scripting grepping multiple matches in a single string Post 302603342 by methyl on Wednesday 29th of February 2012 06:44:14 PM
Old 02-29-2012
There is no sensible way to approach this because there is no proper record structure.
At first glance you have fields delimited by "." ... except the one containing "tailor".

In the future please post "real world" problems from your commercial environment.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Grepping using multiple wildcards

Is there anyway you can grep using multiple wildcards? When I run the below line the results return fine; grep 12345 /usr/local/production/soccermatchplus/distributor/clients/*/out/fixtures.xml | awk -F/ '{print $8}' However ideally, I need it to grep for; grep 12345... (3 Replies)
Discussion started by: JayC89
3 Replies

2. Shell Programming and Scripting

Grepping string from out file

Guys .. Need to pull this highlighted strings irrespective of line numbers & should be echoed . But these strings are from Outfile from different dir. In which way this can be grepped ?? Need an idea http-timeout 120 seconds persistent-timeout 180 seconds host-rewriting on ... (7 Replies)
Discussion started by: raghunsi
7 Replies

3. Shell Programming and Scripting

replace (sed?) a single line/string in file with multiple lines (string) from another file??

Can someone tell me how I can do this? e.g: Say file1.txt contains: today is monday the 22 of NOVEMBER 2010 and file2.txt contains: the 11th month of How do i replace the word NOVEMBER with (5 Replies)
Discussion started by: tuathan
5 Replies

4. Shell Programming and Scripting

SED - Multiple String - Single Line

Would appear to me to be a farily simple question but having search all the threads I can't find the answer .. I just want sed to output the single line in a file that contains two string anywhere on the line.. e.g. currently using this command sed -n -e'/str1/p' -e '/str2/p' < file and... (3 Replies)
Discussion started by: flopster
3 Replies

5. Shell Programming and Scripting

Multiple lines in a single column to be merged as a single line for a record

Hi, I have a requirement with, No~Dt~Notes 1~2011/08/1~"aaa bbb ccc ddd eee fff ggg hhh" Single column alone got splitted into multiple lines. I require the output as No~Dt~Notes 1~2011/08/1~"aaa<>bbb<>ccc<>ddd<>eee<>fff<>ggg<>hhh" mean to say those new lines to be... (1 Reply)
Discussion started by: Bhuvaneswari
1 Replies

6. Shell Programming and Scripting

How to merge multiple rows into single row if first column matches ?

Hi, Can anyone suggest quick way to get desired output? Sample input file content: A 12 9 A -0.3 2.3 B 1.0 -4 C 34 1000 C -111 900 C 99 0.09 Output required: A 12 9 -0.3 2.3 B 1.0 -4 C 34 1000 -111 900 99 0.09 Thanks (3 Replies)
Discussion started by: cbm_000
3 Replies

7. Shell Programming and Scripting

Multiple search strings replaced with single string

Hi, I need someone's help in writing correct perl code. I implemented following code for "multiple search strings replaced with single string". ========================================================= #!/usr/bin/perl my $searchStr = 'register_inst\.write_t\(' |... (2 Replies)
Discussion started by: chettyravi
2 Replies

8. Shell Programming and Scripting

Find multiple strings and replace single string

Hi, following Perl code i used for finding multiple strings and replace with single string. code: #!/usr/bin/perl my @files = <*.txt>; foreach $fileName (@files) { print "$fileName\n"; my $searchStr = ',rdata\)' | ',,rdata\)' | ', ,rdata\)'; my $replaceStr =... (2 Replies)
Discussion started by: chettyravi
2 Replies

9. Shell Programming and Scripting

Grepping only if condition matches

Dear Friends, I have a flat file which is as follows $cat sample 123,456,1,1,1,1 sdfas,345,1,1,1,1 dfgd,234,2,3,4,1 ggffgr,234,4,3,2,1 jkhu,354.1,1,1,1 $ I want to get output of only those lines which has '1' in 3 to 5 position. So I want output as follows 123,456,1,1,1,1... (8 Replies)
Discussion started by: anushree.a
8 Replies

10. Shell Programming and Scripting

Single grep to multiple strings with separate output per string

I need to grep multiple strings from a particular file. I found the use of egrep "String1|String2|String3" file.txt | wc-l Now what I'm really after is that I need to separate word count per each string found. I am trying to keep it to use the grep only 1 time. Can you guys help ? ... (9 Replies)
Discussion started by: nms
9 Replies
TTYACTION(5)						      BSD File Formats Manual						      TTYACTION(5)

NAME
ttyaction -- ttyaction file format DESCRIPTION
The ttyaction file specifies site-specific commands to run when a login session begins and ends. The ttyaction file contains a list of new- line separated records, where each record has the following three fields: ttyname Name of the tty line(s) on which this line should apply. The name is relative to the /dev directory, similar to how such devices are named in the /etc/ttys file. action Name of the action for which this line should apply. The action names currently defined are "login", "getty", "telnetd" and "rlogind" which indicate which program is processing this file. (Note that "login" begins a login session, while the other three are run after a login session ends.) command What command to run if this record matches. The first two fields are delimited with blanks or tabs, and the command field is all text to the end of the line. Either or both of first two fields may contain wildcard match patterns as implemented by the fnmatch() library function. All command strings are executed by passing them to /bin/sh -c running as "root," with an environment containing: TTY=ttyname ACT=action USER=username PATH=_PATH_STDPATH These variables may be used directly in the shell command part of the record for simple tasks such as changing the ownership of related devices. For example: console * chown ${USER}:tty /dev/mouse will chown the mouse appropriately when the console owner changes. EXAMPLES
Here are some more example records: tty0 login /somewhere/tty_setup ${TTY} tty0 getty /somewhere/tty_clean ${TTY} * * /somewhere/ttyfrob ${TTY} ${ACT} SEE ALSO
fnmatch(3), ttyaction(3) HISTORY
The ideas for the /etc/ttyaction file were inspired by the /etc/fbtab file under SunOS. BSD
August 24, 1996 BSD
All times are GMT -4. The time now is 12:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy