11-04-2011
Replace Filename and text inside of directory
I have a directory that has directories that contain Dir-20111114-xyz and I want to change them to Dir-20111121-xyz.
Inside of Dir-20111114-xyz, I have a config.xml file that also contains the date that I need changed from 20111114 to 20111121
I have used sed to replace inside of file not sure how to handle renaming the directories.
Thank you.
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
This is my first post to this group.I am new to Unix.I have one requirement
I need to replace a text in all the files in a directory and sub-directory.Eg i have a folder structure like /usr/local/abc , inside abc i have several directories and several files. All the files inside abc and all the... (1 Reply)
Discussion started by: vatsan
1 Replies
2. Shell Programming and Scripting
<c-param>
<param-name>Number</param-name>
<param-value>22</param-value>
<description>my house number</description>
</c-param>
<c-param>
<param-name>Address</param-name>
... (4 Replies)
Discussion started by: reldb
4 Replies
3. Shell Programming and Scripting
Please Help... I am trying to manipulte the following line
Before :
<user:Account_Password>002786</user:Account_Password>
the password is the "variable", i need to delete / omit the password in the file, (it occurs several thousand times)
so the tag line looks like
After:... (4 Replies)
Discussion started by: jackn7
4 Replies
4. Shell Programming and Scripting
Hi,
I have a few thousand files, each contains the word "hello". Would it be possible to do a batch job that replaces the word hello with the filename?
Thanks. (2 Replies)
Discussion started by: calrog
2 Replies
5. Shell Programming and Scripting
I was google searching and found
Perl as a command line utility tool
This almost solves my problem:
find . | xargs perl -p -i.old -e 's/oldstring/newstring/g'
I think this would create a new file for every file in my directory tree. Most of my files will not contain oldstring and I... (1 Reply)
Discussion started by: siegfried
1 Replies
6. Shell Programming and Scripting
Hi,
I have a situation where I want to replace some occurrences of ".jsp" into ".html" inside a text file.
For Example:
If a pattern found like <a href="http://www.mysite.com/mypage.jsp"> it should be retained.
But if a pattern found like <a href="../mypage.jsp"> it should be changed to... (4 Replies)
Discussion started by: meharo
4 Replies
7. Shell Programming and Scripting
Hi All,
I want to change the name as SEQ_13
ie., <Property Name="Name">SEQ_13</Property>
when the Stage Type is PxSequentialFile
ie., <Property Name="StageType">PxSequentialFile</Property> :wall:
Input.XML
<Main>
<Record Identifier="V0S13" Type="CustomStage" Readonly="0">... (3 Replies)
Discussion started by: kmsekhar
3 Replies
8. Shell Programming and Scripting
Hi all,
Please somebody help me with this:
I want to check if the files listed in a text file, are found under a directory or not.
For example: the file is list_of_files.txt, which contains inside this rows:
# cat list_of_files
logs
errors
paths
debug
#
I want to check if these... (3 Replies)
Discussion started by: arrals_vl
3 Replies
9. Shell Programming and Scripting
I have a directory that is restricted and I cannot just copy the files need, but I can cat them and redirect them to a new directory. The files all have the date listed in them. If I perform a long listing and grep for the date (150620) I can redirect that output to a text file. Now I need to... (5 Replies)
Discussion started by: trigger467
5 Replies
10. Shell Programming and Scripting
I wish to list only files along with the absolute path in a given directory on my AiX 6.1 system.
Below is the best I could do.
ls -p "/app/scripts"/*
This gives a a list of all filename along with folder names with absolute path non-recurrsive (without listing files in sub-directories)... (1 Reply)
Discussion started by: mohtashims
1 Replies
LEARN ABOUT DEBIAN
svn::class::dir
SVN::Class::Dir(3pm) User Contributed Perl Documentation SVN::Class::Dir(3pm)
NAME
SVN::Class::Dir - represents a directory in a Subversion workspace
SYNOPSIS
# see SVN::Class;
DESCRIPTION
This class subclasses Path::Class::Dir and SVN::Class. A SVN::Class::Dir object behaves like a Path::Class::Dir object, but with the extra
Subversion functionality of SVN::Class.
METHODS
There are no new methods implemented in this class.
The following methods are overridden to return SVN::Class-derived objects instead of Path::Class-derived objects.
new
file
AUTHOR
Peter Karman, "<karman at cpan.org>"
BUGS
Please report any bugs or feature requests to "bug-svn-class at rt.cpan.org", or through the web interface at
http://rt.cpan.org/NoAuth/ReportBug.html?Queue=SVN-Class <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=SVN-Class>. I will be notified,
and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc SVN::Class
You can also look for information at:
o AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/SVN-Class <http://annocpan.org/dist/SVN-Class>
o CPAN Ratings
http://cpanratings.perl.org/d/SVN-Class <http://cpanratings.perl.org/d/SVN-Class>
o RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=SVN-Class <http://rt.cpan.org/NoAuth/Bugs.html?Dist=SVN-Class>
o Search CPAN
http://search.cpan.org/dist/SVN-Class <http://search.cpan.org/dist/SVN-Class>
COPYRIGHT & LICENSE
Copyright 2007 by the Regents of the University of Minnesota.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
SVN::Class, Path::Class::Dir
perl v5.14.2 2012-01-31 SVN::Class::Dir(3pm)