Hi
I would like to use a bash script that searches files and
subdirectories name in a directory /var/ww/html/web
for a specific string, and when it finds the search string, replaces
the string (old1) with new string (new1), and so on
old2 with new2 oldn with newn.
replace_string.sh
madu...@gmail.com wrote:
I would like to use a bash script that searches files and
subdirectories name in a directory /var/ww/html/web
for a specific string, and when it finds the search string, replaces
the string (old1) with new string (new1), and so on
old2 with new2 oldn with newn.
-type f ??
the string could be a name of file name or subdirectory name
Thanks
pons
On Fri, Sep 23, 2011 at 8:51 PM, m.r...@5-cent.us wrote:
madu...@gmail.com wrote:
I would like to use a bash script that searches files and
subdirectories name in a directory /var/ww/html/web
for a specific
madu...@gmail.com wrote:
-type f ??
the string could be a name of file name or subdirectory name
No, it can't. You are *not* going to edit directory names this way, and
should not.
mark
Thanks
pons
On Fri, Sep 23, 2011 at 8:51 PM, m.r...@5-cent.us wrote:
madu...@gmail.com wrote:
madu...@gmail.com wrote:
-type f ??
the string could be a name of file name or subdirectory name
I hate webmail. After I hit send and while it was thinking about going,
I realized another question: are you trying to rename files?
mark
Thanks
pons
On Fri, Sep 23, 2011 at 8:51
yes files and directories too ..
pons
On Fri, Sep 23, 2011 at 9:08 PM, m.r...@5-cent.us wrote:
madu...@gmail.com wrote:
-type f ??
the string could be a name of file name or subdirectory name
I hate webmail. After I hit send and while it was thinking about going,
I realized another
madu...@gmail.com wrote:
pons
On Fri, Sep 23, 2011 at 9:08 PM, m.r...@5-cent.us wrote:
madu...@gmail.com wrote:
-type f ??
the string could be a name of file name or subdirectory name
snip
I realized another question: are you trying to rename files?
yes files and directories too ..
Then
On Fri, Sep 23, 2011 at 1:21 PM, m.r...@5-cent.us wrote:
I realized another question: are you trying to rename files?
yes files and directories too ..
Then different commands - sed for the files, mv for the directories.
This begins to look like a perl script.
Either way, it's probably a
Les Mikesell wrote:
On Fri, Sep 23, 2011 at 1:21 PM, m.r...@5-cent.us wrote:
I realized another question: are you trying to rename files?
yes files and directories too ..
Then different commands - sed for the files, mv for the directories.
This begins to look like a perl script.
Either
I am planning to have this in 2 stages first -type fthen -type d
pons
On Fri, Sep 23, 2011 at 11:15 PM, m.r...@5-cent.us wrote:
Les Mikesell wrote:
On Fri, Sep 23, 2011 at 1:21 PM, m.r...@5-cent.us wrote:
I realized another question: are you trying to rename files?
yes files and
On 09/23/11 1:51 PM, madu...@gmail.com wrote:
I am planning to have this in 2 stages first -type fthen -type d
you likely should use the -depth option that says descend first, even if
you do the files seperately if you use -depth, you don't have to
do it in two phases.
--
john
On 2011-09-23 19:47, madu...@gmail.com wrote:
Hi
I would like to use a bash script that searches files and
subdirectories name in a directory /var/ww/html/web
for a specific string, and when it finds the search string, replaces
the string (old1) with new string (new1), and so on
old2 with
On Fri, Sep 23, 2011 at 10:47 AM, madu...@gmail.com madu...@gmail.com wrote:
I would like to use a bash script that searches files and
subdirectories name in a directory /var/ww/html/web
for a specific string, and when it finds the search string, replaces
the string (old1) with new string
how about...
find . -depth -execdir mv \{} ${\{}/old/new} \;
I do highly recommend test-running this with a echo in front of the
mv command. I didn't test it.
--
john r pierceN 37, W 122
santa cruz ca mid-left coast
14 matches
Mail list logo