Sponsored Content
Full Discussion: sed pattern match problem
Top Forums Shell Programming and Scripting sed pattern match problem Post 302524074 by mrpugster on Saturday 21st of May 2011 07:53:18 AM
Old 05-21-2011
sed pattern match problem

Hi all, hoping this is a simple one, tried looking but just can't see the solution

As an example I've got a list of words that all start Ben.....

Bendicks
Benefiber
Ben
Benylin

I need to only change the line Ben with Ben 10, ignoring the other lines.

I tried the following

Quote:
sed -i "s/^Ben/Ben 10/g"
This works however changes all the rest also, how do you get sed to only focus on a select string pattern?

Many thanks
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

sed match closest/nearest pattern

All i am struggling to raplace some text in a line between two (closest) patterns , line="/home/usr/bin/:/home/usr/devuser,n1.9/bin:/home/usr/root/bin" i want to replace "devuser,n1.9" with "NEWVAL", basically all teh text from "devuser" until nearest '/' with some new text. i tried teh... (1 Reply)
Discussion started by: sudheer1984
1 Replies

2. Shell Programming and Scripting

sed print all lines after pattern match

HiCan someone show me how to print all lines from a file after a line matching a pattern using sed?Thanks (13 Replies)
Discussion started by: steadyonabix
13 Replies

3. Shell Programming and Scripting

Match a pattern starting with sub-pattern using sed

Hi all, I've been experiencing a difficulty trying to match a number and write it to a new file. My input file is: input.txt It contains the lines: 103P 123587.256971 3.21472112 3.1517423 1.05897234566427 58.2146258 12.35478 25.3612489 What would be the sed command to... (17 Replies)
Discussion started by: Biederman
17 Replies

4. Shell Programming and Scripting

Sed Pattern Match

Hi, I would like to use SED to do the following string replacement: asd1abc to www1cda asd2abc to www2cda ... asd9abc to www9cda I can use 'asd.abc' to find the orignal string, however I don't know how to generate the target string. Any suggestion? Thanks, ... (2 Replies)
Discussion started by: mail4mz
2 Replies

5. UNIX for Dummies Questions & Answers

sed, join lines that do not match pattern

Hello, Could someone help me with sed. I have searched for solution 5 days allready :wall:, but cant find. Unfortunately my "sed" knowledge not good enough to manage it. I have the text: 123, foo1, bar1, short text1, dat1e, stable_pattern 124, foo2, bar2, long text with few lines, date,... (4 Replies)
Discussion started by: petrasl
4 Replies

6. UNIX for Dummies Questions & Answers

sed multiline pattern match

How can I write a script that takes a cisco config file and outputs every occurrence of two, or more, pattern matches through the whole config file? For example, out of a config file, i want to print out every line with interface, description and ip address through the whole file, and disregard... (3 Replies)
Discussion started by: knownasthatguy
3 Replies

7. Shell Programming and Scripting

sed : match one pattern then the next consecutive second pattern not working

Ive used this snippet of code on a solaris box thousands of times. But it isnt working on the new linux box sed -n '/interface LoopBack0/{N;/ ip address /p;}' *.conf its driving me nuts !! Is there something Im missing ? (7 Replies)
Discussion started by: popeye
7 Replies

8. Shell Programming and Scripting

Pattern match with awk/sed - help

I need to grep for the pattern text inside the square brackets which are in red and not in green..my current code greps patterns both of them, which i don't want Input fileref|XP_002371341.1| oxoacyl-ACP reductase, putative gb|EPT24759.1| 3-ketoacyl-(acyl-carrier-protein) reductase ... (2 Replies)
Discussion started by: selvankj
2 Replies

9. Shell Programming and Scripting

sed - pattern match - apply substitution

Greetings Experts, I am on AIX and in process of creating a re-startable script that connects to Oracle and executes the statements. The sample contents of the file1 is CREATE OR REPLACE VIEW DB_V.TAB1 AS SELECT * FROM DB_T.TAB1; .... CREATE OR REPLACE VIEW DB_V.TAB10 AS SELECT * FROM... (9 Replies)
Discussion started by: chill3chee
9 Replies

10. Shell Programming and Scripting

Get range out using sed or awk, only if given pattern match

Input: START OS:: UNIX Release: xxx Version: xxx END START OS:: LINUX Release: xxx Version: xxx END START OS:: Windows Release: xxx Version: xxx ENDHere i am trying to get all the information between START and END, only if i could match OS Type. I can get all the data between the... (3 Replies)
Discussion started by: Dharmaraja
3 Replies
DateTime::Locale::ak(3) 				User Contributed Perl Documentation				   DateTime::Locale::ak(3)

NAME
DateTime::Locale::ak SYNOPSIS
use DateTime; my $dt = DateTime->now( locale => 'ak' ); print $dt->month_name(); DESCRIPTION
This is the DateTime locale package for Akan. DATA
This locale inherits from the DateTime::Locale::root locale. It contains the following data. Days Wide (format) Dwowda Benada Wukuda Yawda Fida Memeneda Kwesida Abbreviated (format) Dwo Ben Wuk Yaw Fia Mem Kwe Narrow (format) D B W Y F M K Wide (stand-alone) Dwowda Benada Wukuda Yawda Fida Memeneda Kwesida Abbreviated (stand-alone) Dwo Ben Wuk Yaw Fia Mem Kwe Narrow (stand-alone) D B W Y F M K Months Wide (format) Sanda-XpXpXn Kwakwar-Xgyefuo EbXw-Xbenem EbXbira-Oforisuo Esusow Aketseaba-KXtXnimba Obirade-AyXwohomumu AyXwoho-Kitawonsa Difuu-Xsandaa Fankwa-XbX XbXsX-Ahinime XberXfXw-Obubuo Mumu-XpXnimba Abbreviated (format) S-X K-X E-X E-O E-K O-A A-K D-X F-X X-A X-O M-X Narrow (format) 1 2 3 4 5 6 7 8 9 10 11 12 Wide (stand-alone) Sanda-XpXpXn Kwakwar-Xgyefuo EbXw-Xbenem EbXbira-Oforisuo Esusow Aketseaba-KXtXnimba Obirade-AyXwohomumu AyXwoho-Kitawonsa Difuu-Xsandaa Fankwa-XbX XbXsX-Ahinime XberXfXw-Obubuo Mumu-XpXnimba Abbreviated (stand-alone) S-X K-X E-X E-O E-K O-A A-K D-X F-X X-A X-O M-X Narrow (stand-alone) 1 2 3 4 5 6 7 8 9 10 11 12 Quarters Wide (format) Q1 Q2 Q3 Q4 Abbreviated (format) Q1 Q2 Q3 Q4 Narrow (format) 1 2 3 4 Wide (stand-alone) Q1 Q2 Q3 Q4 Abbreviated (stand-alone) Q1 Q2 Q3 Q4 Narrow (stand-alone) 1 2 3 4 Eras Wide Ansa Kristo Kristo Ekyiri Abbreviated AK KE Narrow AK KE Date Formats Full 2008-02-05T18:30:30 = Benada, 2008 Kwakwar-Xgyefuo 05 1995-12-22T09:05:02 = Fida, 1995 Mumu-XpXnimba 22 -0010-09-15T04:44:23 = Memeneda, -10 Fankwa-XbX 15 Long 2008-02-05T18:30:30 = 2008 Kwakwar-Xgyefuo 5 1995-12-22T09:05:02 = 1995 Mumu-XpXnimba 22 -0010-09-15T04:44:23 = -10 Fankwa-XbX 15 Medium 2008-02-05T18:30:30 = 2008 K-X 5 1995-12-22T09:05:02 = 1995 M-X 22 -0010-09-15T04:44:23 = -10 F-X 15 Short 2008-02-05T18:30:30 = 08/02/05 1995-12-22T09:05:02 = 95/12/22 -0010-09-15T04:44:23 = -10/09/15 Default 2008-02-05T18:30:30 = 2008 K-X 5 1995-12-22T09:05:02 = 1995 M-X 22 -0010-09-15T04:44:23 = -10 F-X 15 Time Formats Full 2008-02-05T18:30:30 = 18:30:30 UTC 1995-12-22T09:05:02 = 09:05:02 UTC -0010-09-15T04:44:23 = 04:44:23 UTC Long 2008-02-05T18:30:30 = 18:30:30 UTC 1995-12-22T09:05:02 = 09:05:02 UTC -0010-09-15T04:44:23 = 04:44:23 UTC Medium 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 09:05:02 -0010-09-15T04:44:23 = 04:44:23 Short 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 09:05 -0010-09-15T04:44:23 = 04:44 Default 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 09:05:02 -0010-09-15T04:44:23 = 04:44:23 Datetime Formats Full 2008-02-05T18:30:30 = Benada, 2008 Kwakwar-Xgyefuo 05 18:30:30 UTC 1995-12-22T09:05:02 = Fida, 1995 Mumu-XpXnimba 22 09:05:02 UTC -0010-09-15T04:44:23 = Memeneda, -10 Fankwa-XbX 15 04:44:23 UTC Long 2008-02-05T18:30:30 = 2008 Kwakwar-Xgyefuo 5 18:30:30 UTC 1995-12-22T09:05:02 = 1995 Mumu-XpXnimba 22 09:05:02 UTC -0010-09-15T04:44:23 = -10 Fankwa-XbX 15 04:44:23 UTC Medium 2008-02-05T18:30:30 = 2008 K-X 5 18:30:30 1995-12-22T09:05:02 = 1995 M-X 22 09:05:02 -0010-09-15T04:44:23 = -10 F-X 15 04:44:23 Short 2008-02-05T18:30:30 = 08/02/05 18:30 1995-12-22T09:05:02 = 95/12/22 09:05 -0010-09-15T04:44:23 = -10/09/15 04:44 Default 2008-02-05T18:30:30 = 2008 K-X 5 18:30:30 1995-12-22T09:05:02 = 1995 M-X 22 09:05:02 -0010-09-15T04:44:23 = -10 F-X 15 04:44:23 Available Formats d (d) 2008-02-05T18:30:30 = 5 1995-12-22T09:05:02 = 22 -0010-09-15T04:44:23 = 15 EEEd (d EEE) 2008-02-05T18:30:30 = 5 Ben 1995-12-22T09:05:02 = 22 Fia -0010-09-15T04:44:23 = 15 Mem Hm (H:mm) 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 9:05 -0010-09-15T04:44:23 = 4:44 hm (h:mm a) 2008-02-05T18:30:30 = 6:30 EW 1995-12-22T09:05:02 = 9:05 AN -0010-09-15T04:44:23 = 4:44 AN Hms (H:mm:ss) 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 9:05:02 -0010-09-15T04:44:23 = 4:44:23 hms (h:mm:ss a) 2008-02-05T18:30:30 = 6:30:30 EW 1995-12-22T09:05:02 = 9:05:02 AN -0010-09-15T04:44:23 = 4:44:23 AN M (L) 2008-02-05T18:30:30 = 2 1995-12-22T09:05:02 = 12 -0010-09-15T04:44:23 = 9 Md (M-d) 2008-02-05T18:30:30 = 2-5 1995-12-22T09:05:02 = 12-22 -0010-09-15T04:44:23 = 9-15 MEd (E, M-d) 2008-02-05T18:30:30 = Ben, 2-5 1995-12-22T09:05:02 = Fia, 12-22 -0010-09-15T04:44:23 = Mem, 9-15 MMM (LLL) 2008-02-05T18:30:30 = K-X 1995-12-22T09:05:02 = M-X -0010-09-15T04:44:23 = F-X MMMd (MMM d) 2008-02-05T18:30:30 = K-X 5 1995-12-22T09:05:02 = M-X 22 -0010-09-15T04:44:23 = F-X 15 MMMEd (E MMM d) 2008-02-05T18:30:30 = Ben K-X 5 1995-12-22T09:05:02 = Fia M-X 22 -0010-09-15T04:44:23 = Mem F-X 15 MMMMd (MMMM d) 2008-02-05T18:30:30 = Kwakwar-Xgyefuo 5 1995-12-22T09:05:02 = Mumu-XpXnimba 22 -0010-09-15T04:44:23 = Fankwa-XbX 15 MMMMEd (E MMMM d) 2008-02-05T18:30:30 = Ben Kwakwar-Xgyefuo 5 1995-12-22T09:05:02 = Fia Mumu-XpXnimba 22 -0010-09-15T04:44:23 = Mem Fankwa-XbX 15 ms (mm:ss) 2008-02-05T18:30:30 = 30:30 1995-12-22T09:05:02 = 05:02 -0010-09-15T04:44:23 = 44:23 y (y) 2008-02-05T18:30:30 = 2008 1995-12-22T09:05:02 = 1995 -0010-09-15T04:44:23 = -10 yM (y-M) 2008-02-05T18:30:30 = 2008-2 1995-12-22T09:05:02 = 1995-12 -0010-09-15T04:44:23 = -10-9 yMEd (EEE, y-M-d) 2008-02-05T18:30:30 = Ben, 2008-2-5 1995-12-22T09:05:02 = Fia, 1995-12-22 -0010-09-15T04:44:23 = Mem, -10-9-15 yMMM (y MMM) 2008-02-05T18:30:30 = 2008 K-X 1995-12-22T09:05:02 = 1995 M-X -0010-09-15T04:44:23 = -10 F-X yMMMEd (EEE, y MMM d) 2008-02-05T18:30:30 = Ben, 2008 K-X 5 1995-12-22T09:05:02 = Fia, 1995 M-X 22 -0010-09-15T04:44:23 = Mem, -10 F-X 15 yMMMM (y MMMM) 2008-02-05T18:30:30 = 2008 Kwakwar-Xgyefuo 1995-12-22T09:05:02 = 1995 Mumu-XpXnimba -0010-09-15T04:44:23 = -10 Fankwa-XbX yQ (y Q) 2008-02-05T18:30:30 = 2008 1 1995-12-22T09:05:02 = 1995 4 -0010-09-15T04:44:23 = -10 3 yQQQ (y QQQ) 2008-02-05T18:30:30 = 2008 Q1 1995-12-22T09:05:02 = 1995 Q4 -0010-09-15T04:44:23 = -10 Q3 yyQ (Q yy) 2008-02-05T18:30:30 = 1 08 1995-12-22T09:05:02 = 4 95 -0010-09-15T04:44:23 = 3 -10 Miscellaneous Prefers 24 hour time? Yes Local first day of the week Dwowda SUPPORT
See DateTime::Locale. AUTHOR
Dave Rolsky <autarch@urth.org> COPYRIGHT
Copyright (c) 2008 David Rolsky. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. This module was generated from data provided by the CLDR project, see the LICENSE.cldr in this distribution for details on the CLDR data's license. perl v5.16.3 2014-06-10 DateTime::Locale::ak(3)
All times are GMT -4. The time now is 04:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy