10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a environment property file which contains:
Input file:
value1 = url1
value2 = url2
value3 = url3 and so on.
I need to search all *.xml files under directory for value1 and replace it with url1.
Same thing I have to do for all values mentioned in input file. I need script in unix bash... (7 Replies)
Discussion started by: Shamkamde
7 Replies
2. UNIX for Dummies Questions & Answers
Hi!
I have a directory full of .plist type files from which I need to delete a line. Not every file contains the line, but of course I'd like to do it recursively. The line which I want to delete is:
<string>com.apple.PhotoBooth</string>
and looks like this in its native habitat:
... (9 Replies)
Discussion started by: sudon't
9 Replies
3. Shell Programming and Scripting
I have a list of files all over a file system e.g.
/home/1/foo/bar.x
/www/sites/moose/foo.txtI'm looking for strings in these files and want to replace each occurrence with a replacement string, e.g.
if I find: '#@!^\&@ in any of the files I want to replace it with: 655#@11, etc.
There... (2 Replies)
Discussion started by: spacegoose
2 Replies
4. Shell Programming and Scripting
Hey guys. I know pratically 0 about Linux, so could anyone please give me instructions on how to accomplish this ?
The distro is RedHat 4.1.2 and i need to find and replace a multiple lines string in several php files across subdirectories.
So lets say im at root/dir1/dir2/ , when i execute... (12 Replies)
Discussion started by: spfc_dmt
12 Replies
5. Shell Programming and Scripting
Hi all.
I have the following command that is successfully searching for any one of the strings on all lines of a file and replacing it with the instructed value.
cat inputFile | awk '{gsub(/aaa|bbb|ccc|ddd/,"1234")}1' > outputFile
This does in fact replace any occurrence of aaa, bbb,... (2 Replies)
Discussion started by: dazhoop
2 Replies
6. Shell Programming and Scripting
Hi,
I have a folder which contains multiple config.xml files and one input file, Please see the below format.
Config Files format looks like :-
Code:
<application name="SAMPLE-ARCHIVE">
<NVPairs name="Global Variables">
<NameValuePair>
... (0 Replies)
Discussion started by: haiksuresh
0 Replies
7. Shell Programming and Scripting
Hi,
I am creating a script to do a find and replace single/multiple lines in a file with any number of lines.
I have written a logic in a script that reads a reference file say "findrep" and populates two variables $FIND and $REPLACE
print $FIND gives
Hi How r $u
Rahul()
Note:... (0 Replies)
Discussion started by: r_sarnayak
0 Replies
8. UNIX for Dummies Questions & Answers
Hiiii Friends
I have 2 files with huge data. I want to compare this 2 files & if they hav same set of vales in specific rows & columns i need to get that value from one file & replace it in other.
For example: I have few set data of both files here:
a.dat:
PDE-W 2009 12 16 5 29 11.11 ... (10 Replies)
Discussion started by: reva
10 Replies
9. UNIX for Dummies Questions & Answers
Is this something SED would be used for or can AWK do it?
I have a string that I would like to chop bits out of and re-arrange some of the rest.
Basically I want to change this:
<log4j:event logger="webserver" timestamp="1240110840109" time="Sun Apr 19 04:14:00 BST 2009" level="INFO"... (4 Replies)
Discussion started by: Sepia
4 Replies
10. Shell Programming and Scripting
Hi there,
I would like to write a script to automate the copy and renaming of files in multiple dir.
I have a generic file named s253e.prb and would like to copy this to multiple dir and rename it.
Example:
Dir is AL-M1 and the prb file name is AL-M1.prb. I would like to be able to... (6 Replies)
Discussion started by: lodey
6 Replies
File::Find::Rule::Procedural(3pm) User Contributed Perl Documentation File::Find::Rule::Procedural(3pm)
NAME
File::Find::Rule::Procedural - File::Find::Rule's procedural interface
SYNOPSIS
use File::Find::Rule;
# find all .pm files, procedurally
my @files = find(file => name => '*.pm', in => @INC);
DESCRIPTION
In addition to the regular object-oriented interface, File::Find::Rule provides two subroutines for you to use.
"find( @clauses )"
"rule( @clauses )"
"find" and "rule" can be used to invoke any methods available to the OO version. "rule" is a synonym for "find"
Passing more than one value to a clause is done with an anonymous array:
my $finder = find( name => [ '*.mp3', '*.ogg' ] );
"find" and "rule" both return a File::Find::Rule instance, unless one of the arguments is "in", in which case it returns a list of things
that match the rule.
my @files = find( name => [ '*.mp3', '*.ogg' ], in => $ENV{HOME} );
Please note that "in" will be the last clause evaluated, and so this code will search for mp3s regardless of size.
my @files = find( name => '*.mp3', in => $ENV{HOME}, size => '<2k' );
^
|
Clause processing stopped here ------/
It is also possible to invert a single rule by prefixing it with "!" like so:
# large files that aren't videos
my @files = find( file =>
'!name' => [ '*.avi', '*.mov' ],
size => '>20M',
in => $ENV{HOME} );
AUTHOR
Richard Clamp <richardc@unixbeard.net>
COPYRIGHT
Copyright (C) 2003 Richard Clamp. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
File::Find::Rule
perl v5.12.4 2011-09-19 File::Find::Rule::Procedural(3pm)