Sponsored Content
Top Forums Shell Programming and Scripting Recursive search on pattern between two strings Post 302606124 by bartus11 on Friday 9th of March 2012 03:28:22 PM
Old 03-09-2012
Try:
Code:
perl -ln0e 'while (/UPDATE.*?(?=UPDATE|;);?/sg){$x=$&;print $x if $x=~/;/}' file

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

non recursive search in the current directory only

Hi, Am trying for a script which should delete more than 15 days older files in my current directory.Am using the below piece of code: "find /tmp -type f -name "pattern" -mtime +15 -exec /usr/bin/ls -altr {} \;" "find /tmp -type f -name "pattern" -mtime +15 -exec /usr/bin/rm -f {} \;" ... (9 Replies)
Discussion started by: puppala
9 Replies

2. Shell Programming and Scripting

search a pattern and if pattern found insert new pattern at the begining

I am trying to do some thing like this .. In a file , if pattern found insert new pattern at the begining of the line containing the pattern. example: in a file I have this. gtrow0unit1/gctunit_crrownorth_stage5_outnet_feedthru_pin if i find feedthru_pin want to insert !! at the... (7 Replies)
Discussion started by: pitagi
7 Replies

3. Shell Programming and Scripting

Wget recursive with query strings

I am recursively downloading the archive of our emaillist provider with wget, as our provider is shutting down the listserver soon. The list is located at https://listserv.surfnet.nl/archives/umpm-bulletin.html Now I cant make wget save the query-string part of the url, for example... (1 Reply)
Discussion started by: eiland
1 Replies

4. UNIX for Dummies Questions & Answers

recursive search and ftp

Could someone help me in recursive search and ftp'ing the files to remote server? The host machine will have /dir1/dira/list_of_files1 /dir1/dirb/list_of_files2 /dir1/dirc/list_of_files3 . . . so., I need to search from dir1 recursively (only one level down) and find all the files that... (1 Reply)
Discussion started by: brahmi
1 Replies

5. UNIX for Advanced & Expert Users

Recursive directory search using ls instead of find

I was working on a shell script and found that the find command took too long, especially when I had to execute it multiple times. After some thought and research I came up with two functions. fileScan() filescan will cd into a directory and perform any operations you would like from within... (8 Replies)
Discussion started by: newreverie
8 Replies

6. UNIX for Advanced & Expert Users

Recursive search for filenames containing ..

Hi all, Since my gopher server doesn't like filenames containing 2 or more consecutive dots in a filename, I'd like to do a search for them and replace them with... well, let's say underscores... I've tried a oneliner or 2 from other posts, but they don't seem to work well with locating dots.... (3 Replies)
Discussion started by: Evert
3 Replies

7. Shell Programming and Scripting

recursive search and copy

Hello again. Well, I need help again sooner as I thought. Now I want to search for files with a known name within all subdirs, and copy the to differently named files in the same directory. For example if I had only one file to copy, I would just usecp fileName newFileNamebut to do this... (1 Reply)
Discussion started by: cabaciucia
1 Replies

8. Shell Programming and Scripting

awk to search similar strings and arrange in a specified pattern

Hi, I'm running a DB query which returns names of people and writes it in a text file as shown below: Carey, Jim; Cena, John Cena, John Sen, Tim; Burt, Terrence Lock, Jessey; Carey, Jim Norris, Chuck; Lee, Bruce Rock, Dwayne; Lee, Bruce I want to use awk and get all the names... (9 Replies)
Discussion started by: prashu_g
9 Replies

9. OS X (Apple)

Search recursive

before posting, I have tried to find my answer elsewhere. no luck. I need to find a file buried in a folder somewhere. Master folder has 10 sub folders. each sub folder has folders too. I found this but it does nothing I am on Mac and use Applescript. do shell script "find... (2 Replies)
Discussion started by: sbrady
2 Replies

10. UNIX for Beginners Questions & Answers

Grep/awk using a begin search pattern and end search pattern

I have this fileA TEST FILE ABC this file contains ABC; TEST FILE DGHT this file contains DGHT; TEST FILE 123 this file contains ABC, this file contains DEF, this file contains XYZ, this file contains KLM ; I want to have a fileZ that has only (begin search pattern for will be... (2 Replies)
Discussion started by: vbabz
2 Replies
UPDATE-BOOTLOADER(1)                                    User Contributed Perl Documentation                                   UPDATE-BOOTLOADER(1)

NAME
update-bootloader - update/change bootloader configuration using Bootloader::Tools perl module SYNOPSIS
update-bootloader [operation] [options] operation is one of --add, --remove or --refresh. valid options are --help, --man, --image <file>, --initrd <file>, --xen-kernel <file>, --xen, --default, --previous, --name <string>, --force, --force-default. DESCRIPTION
update-bootloader will let you modify your bootloader configuration using Bootloader::Tools perl module. OPERATIONS
--add add an new image section. Needs a call to --refresh to take effect. --remove remove the specified image section. Needs a call to --refresh to take effect. --refresh activate the new config e.g. write boot loader to disk PARAMETER
--help Print a brief help message and exits. --man Prints the manual page and exits. --image file specify path to kernel image --initrd file specify path to initrd file --xen specify that you what to add a xen and not a regular image section --xen-kernel file specify that you what to add a xen section with a specific image. Implies --xen option. --default let the new section to be added be the default section if appropriate. Only allowed together with --add operation --previous set some usuable defaults for image, initrd and name when --name string specify the name of the section to be added/removed --force dont complain, just do the right thing --force-default force the new section to be added to be the default section. Only allowed together with --add operation perl v5.12.1 2010-04-22 UPDATE-BOOTLOADER(1)
All times are GMT -4. The time now is 03:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy