Sponsored Content
Top Forums Shell Programming and Scripting Find and Replace Path in UNIX Post 302751525 by RudiC on Friday 4th of January 2013 05:22:52 AM
Old 01-04-2013
Now this is clear - you did not post the offending command in post#1.
Code:
sed: command garbled: s_/search/path_old_/replace/path_new/_

cannot interpret the substitute command as your separator "_" also exists in your patterns! Replace separator by ":" and it flies.
 

10 More Discussions You Might Find Interesting

1. HP-UX

URGENT: UNIX FTP cannot find path error

Dear all We are currently working on to install some ERP system in wjhich we need to FTP from unix to windows 2000 machine We run ./lodrun to get files from d/xxxxx/xxxx directory but the ftpoutput.log file shows following error FTP: xxxxxxxxx system cannot find the path specified... (1 Reply)
Discussion started by: minix
1 Replies

2. UNIX for Advanced & Expert Users

how to find complete path of a file in unix

hi experts(novice people can stay away as it is no child's game), i am developing a script which works like recycle bin of windows. the problem i am facing is that when ever i am trying to delete a file which is situated in parent directory or parent's parent directory i am unable to capture... (1 Reply)
Discussion started by: yahoo!
1 Replies

3. UNIX for Dummies Questions & Answers

how to find complete path of a file in unix

hi experts(novice people can stay away as it is no child's game), i am developing a script which works like recycle bin of windows. the problem i am facing is that when ever i am trying to delete a file which is situated in parent directory or parent's parent directory i am unable to capture... (5 Replies)
Discussion started by: yahoo!
5 Replies

4. UNIX for Dummies Questions & Answers

how to find a path within unix root directory

I need to know whether nyfile/mypath exists on the file system in the root directory. How to do this (1 Reply)
Discussion started by: ramky79
1 Replies

5. UNIX for Dummies Questions & Answers

Find unix path to a file?

I know this is very newbie ... but I need help determining the proper file path to file...Have no idea how to do this I'm on a Mac OS X 10.6 Snow Leopard thanks very much (4 Replies)
Discussion started by: jmarc
4 Replies

6. Shell Programming and Scripting

Find and replace string from file which contains variable and path - SH

e.g. /home/$USER/.config replace it with "" (empty) Is this possible? I think you should play a bit with sharps ## and sed:b: (2 Replies)
Discussion started by: hakermania
2 Replies

7. Emergency UNIX and Linux Support

Find, replace, file path in multiple files for Solaris 10

Guys I have a big issue that I need to get fixed ASAP however I can not seem to find a way to do it. We started to use zones with Solaris 10 at work and we moved a zone from a SIT box to a DEV box. Problem is the software we have installed is looking at a /lcl/sit/apps/ path and it needs to look... (5 Replies)
Discussion started by: LRoberts
5 Replies

8. Shell Programming and Scripting

find and replace a path with sed?

Hi, I am attempting to find the path /subject/grin* and replace it with /subject/$i My attempt: for i in $(ls) do sed -e 's:"/subjects/grin.*":"/subjects/$i.*":g' and several variants with no luck. Please help. Thanks! (8 Replies)
Discussion started by: JC_1
8 Replies

9. Shell Programming and Scripting

Pattern match a path anywhere in the line and replace it with new path

I want to pattern match only path part from below and replace them with new path string. LoadModule jk_module /fldrA/fldrBaf/fldrCaa/modules/mod_jk.so JkWorkersFile /fldrA/fldrBaf/fldrCaa/config/OHS/ohs1/workers.properties JkLogFile... (4 Replies)
Discussion started by: kchinnam
4 Replies

10. Shell Programming and Scripting

Find and replace the path value in files, pattern is not full known.

Hi, I need to do find and replace, but the pattern is not full known. for example, my file has /proj/app-d1/sun or /data/site-d1/conf here app-d1 and site-d1 is not constant. It may be different in different files. common part is /proj/xx/sun and /data/xxx/conf i want to find where ever... (6 Replies)
Discussion started by: rbalaj16
6 Replies
SVN::Hooks::UpdateConfFile(3pm) 			User Contributed Perl Documentation			   SVN::Hooks::UpdateConfFile(3pm)

NAME
SVN::Hooks::UpdateConfFile - Maintain the repository configuration versioned. VERSION
version 1.19 SYNOPSIS
This SVN::Hooks plugin allows you to maintain the repository configuration files under version control. The repository configuration is usually kept in the directory "conf" under the directory where the repository was created. In a brand new repository you see there the files "authz", "passwd", and "svnserve.conf". It's too bad that these important files are usually kept out of any version control system. This plugin tries to solve this problem allowing you to keep these files versioned under the same repository where they are used. It's active in the "pre-commit" and the "post-commit" hooks. It's configured by the following directive. UPDATE_CONF_FILE(FROM, TO, @ARGS) This directive tells that after a successful commit the file FROM, kept under version control, must be copied to TO. FROM can be a string or a qr/Regexp/ specifying the file path relative to the repository's root (e.g. "trunk/src/version.c" or "qr:^conf/(w+).conf$:"). TO is a path relative to the "/repo/conf" directory in the server. It can be an explicit file name or a directory, in which case the basename of FROM is used as the name of the destination file. If FROM is a qr/Regexp/, TO is evaluated as a string in order to allow for the interpolation of capture buffers from the regular expression. This is useful to map the copy operation to a diferent directory structure. For example, this configuration "qr:^conf/(w+).conf$: => '$1.conf'" updates any .conf file in the repository conf directory. The optional @ARGS must be a sequence of pairs like these: validator => ARRAY or CODE A validator is a function or a command (specified by an array of strings that will be passed to the shell) that will check the contents of FROM in the pre-commit hook to see if it's valid. If there is no validator, the contents are considered valid. The function receives three arguments: A string with the contents of FROM A string with the relative path to FROM in the repository An SVN::Look object representing the commit transaction The command is called with three arguments: The path to a temporary copy of FROM The relative path to FROM in the repository The path to the root of the repository in the server generator => ARRAY or CODE A generator is a function or a command (specified by an array of strings that will be passed to the shell) that will transform the contents of FROM in the post-commit hook before copying it to TO. If there is no generator, the contents are copied as is. The function receives the same three arguments as the validator's function above. The command is called with the same three arguments as the validator's command above. actuator => ARRAY or CODE An actuator is a function or a command (specified by an array of strings that will be passed to the shell) that will be invoked after a successful commit of FROM in the post-commit hook. The function receives the same three arguments as the validator's function above. The command is called with the same three arguments as the validator's command above. rotate => NUMBER By default, after each successful commit the TO file is overwriten by the new contents of FROM. With this option, the last NUMBER versions of TO are kept on disk with numeric suffixes ranging from .0 to ".NUMBER-1". This can be useful, for instance, in case you manage to commit a wrong authz file that denies any subsequent commit. UPDATE_CONF_FILE( 'conf/authz' => 'authz', validator => ['/usr/local/bin/svnauthcheck'], generator => ['/usr/local/bin/authz-expand-includes'], actuator => ['/usr/local/bin/notify-auth-change'], rotate => 2, ); UPDATE_CONF_FILE( 'conf/svn-hooks.conf' => 'svn-hooks.conf', validator => [qw(/usr/bin/perl -c)], actuator => sub { my ($contents, $file) = @_; die "Can't use Gustavo here." if $contents =~ /gustavo/; }, rotate => 2, ); UPDATE_CONF_FILE( qr:/file( +)$:' => 'subdir/$1/file', rotate => 2, ); AUTHOR
Gustavo L. de M. Chaves <gnustavo@cpan.org> COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by CPqD. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2012-06-24 SVN::Hooks::UpdateConfFile(3pm)
All times are GMT -4. The time now is 05:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy