find . -type f -name "*.sql" -print|xargs perl -i -pe 's/pattern/replaced/g'
this is simple logic to find and replace in multiple files & folders
Hope this helps.
Thanks
Zaheer (0 Replies)
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)
Hi all
I'm in need of a command which can replace a specified string with another string - across multiple files within multiple sub-directories (I intend to run it from / )
I've used the following to get a list of the files:
find . | xargs grep <string1>
But that's as far as I've got.... (7 Replies)
Hi All,
Iam new to unix, I need to find string and replace it in the file name. Like
text_123_0.txt,text_123_1.txt,text_123_2.txt. I need to search 123 and replace it with 234 . Is there any unix command to replace them in single command since i have 5 directories. So i need to go each and every... (0 Replies)
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)
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)
When I use special characters the command to replace multiple files with a string pattern does nt work.
---------- Post updated at 12:33 PM ---------- Previous update was at 11:38 AM ----------
This works
perl -pi -e 's/100/test/g' *
This does nt work
perl -pi -e 's... (1 Reply)
Hello,
I have hundreds of files in which I need to change email address. Here is what I am trying to do:
1. All text files are in a directory "a"
2. In the text file, I want to replace email address for preparer. All these lines start with {{PreparerEmail and end with }}. The email... (3 Replies)
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)
Hi there,
I am using AIX and trying to search and replace a string with another string in multiple files in different directories.
I wanted to search replace in steps so I don't change all of the instance anywhere in the server at once, minimizing impact.
STEP 1:
--------
I first searched... (5 Replies)
Discussion started by: zaino22
5 Replies
LEARN ABOUT DEBIAN
dh-exec
DH-EXEC(1) dh-exec DH-EXEC(1)NAME
dh-exec - Debhelper executable file helpers
SYNOPSIS
#! /usr/bin/dh-exec
src/libfoo-*.so.* debian/foo-plugins/usr/lib/foo/${DEB_HOST_MULTIARCH}/
etc/example.conf => debian/foo/etc/foo/foo.conf
DESCRIPTION
dh-exec is a simple program, meant to be used as the interpreter for executable debhelper config files.
It is a wrapper around the various other sub-commands (see below), and will pipe the input file through all of them in turn, using an
ordering that makes most sense in the vast majority of cases.
The order as of now is dh-exec-subst gets run first, followed by dh-exec-install, so that variable expansion happens before files need to
be copied.
ARCHITECTURE
dh-exec is built up from three layers: there is the dh-exec utility, its single entry point, the only thing one will need to call.
Below that, there are the various sub-commands, such as dh-exec-subst, dh-exec-installs and dh-exec-illiterate, which are thin wrappers
around the various dh-exec scripts, that make sure they only run those that need to be run.
And the lowest layer are the various scripts that do the actual work.
One can control which sub-commands to run, or if even more granularity is desired, one can limit which scripts shall be run, too. See below
for the options!
OPTIONS
--with=command[,command ...]
Replace the list of sub-commands to run the input through with a custom list (where entries are separated by whitespace or commas).
This option will always replace the existing list with whatever is specified.
This can be used to explicitly set which sub-commands to use.
The list must not include the dh-exec- prefix.
Defaults to subst,install.
--without=command[,command ...]
Inversely to the option above, this lists all the sub-commands which should not be used.
The list must not include the dh-exec- prefix.
--with-scripts=script[,script ...]
Replace the list of scripts to run the input through with a custom list (where entries are separated by whitespace or commas). This
option will always replace the existing list with whatever is specified.
This can be used to explicitly specify which scripts to use, limiting even beyond what the --with option is capable of.
The list must not include the dh-exec- prefix.
By default it is empty, meaning there is no filtering done, and whatever scripts the sub-commands find, will be run.
--no-act
Do not really do anything, but print the pipeline that would have been run instead.
--list
List the available sub-commands and scripts, grouped by sub-command.
--help, --version
Display a short help or the package version, respectively.
SUB-COMMANDS
dh-exec-subst
Substitutes various variables (either from the environment, or from dpkg-architecture(1)).
dh-exec-install
An extension to dh_install(1), that supports renaming files during the copy process, using a special syntax.
ENVIRONMENT
DH_EXEC_LIBDIR
The directory in which the wrapped sub-commands reside. Defaults to /usr/lib/dh-exec/.
DH_EXEC_SCRIPTDIR
The directory in which the scripts that do the heavy work live. Defaults to /usr/share/dh-exec/.
FILES
$DH_EXEC_LIBDIR/dh-exec-*
The various sub-commands.
$DH_EXEC_SCRIPTDIR/dh-exec-*
The various scripts ran by the sub-commands.
SEE ALSO debhelper(1), dh-exec-subst(1), dh-exec-install(1)AUTHOR
dh-exec is copyright (C) 2011-2012 by Gergely Nagy <algernon@madhouse-project.org>.
2012-05-03 DH-EXEC(1)