Sponsored Content
Top Forums Shell Programming and Scripting Find and Replace Path in UNIX Post 302751463 by nsyed.dw on Friday 4th of January 2013 03:16:28 AM
Old 01-04-2013
Linux Find and Replace Path in UNIX

Hi All,

How can i find and replace the one path to another path with in the file.

For Example:

Code:
Search_path=/search/path
replace_path=/replace/path

I used the following command but not usefull, please help me regarding the same.

Code:
sed 's_/search/path_/replace/path_' file_name > tmp_file.txt


Last edited by Scrutinizer; 01-04-2013 at 04:19 AM.. Reason: code tags
 

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
RAKE(1) 						 Ruby Programmers Reference Guide						   RAKE(1)

NAME
rake -- Ruby Make SYNOPSIS
rake [--f Rakefile] [--version] [-CGNPgnqstv] [-D [PATTERN]] [-E CODE] [-I LIBDIR] [-R RAKELIBDIR] [-T [PATTERN]] [-e CODE] [-p CODE] [-r MODULE] [--rules] [variable=value] target ... DESCRIPTION
Rake is a simple ruby(1) build program with capabilities similar to the regular make(1) command. Rake has the following features: o Rakefiles (Rake's version of Makefiles) are completely defined in standard Ruby syntax. No XML files to edit. No quirky Makefile syntax to worry about (is that a tab or a space?). o Users can specify tasks with prerequisites. o Rake supports rule patterns to synthesize implicit tasks. o Flexible FileLists that act like arrays but know about manipulating file names and paths. o A library of prepackaged tasks to make building rakefiles easier. OPTIONS
--version Display the program version. -C --classic-namespace Put Task and FileTask in the top level namespace -D [PATTERN] --describe [PATTERN] Describe the tasks (matching optional PATTERN), then exit. -E CODE --execute-continue CODE Execute some Ruby code, then continue with normal task processing. -G --no-system --nosystem Use standard project Rakefile search paths, ignore system wide rakefiles. -I LIBDIR --libdir LIBDIR Include LIBDIR in the search path for required modules. -N --no-search --nosearch Do not search parent directories for the Rakefile. -P --prereqs Display the tasks and dependencies, then exit. -R RAKELIBDIR --rakelib RAKELIBDIR --rakelibdir RAKELIBDIR Auto-import any .rake files in RAKELIBDIR. (default is rakelib ) -T [PATTERN] --tasks [PATTERN] Display the tasks (matching optional PATTERN) with descriptions, then exit. -e CODE --execute CODE Execute some Ruby code and exit. -f FILE --rakefile FILE Use FILE as the rakefile. -h --help Prints a summary of options. -g --system Using system wide (global) rakefiles (usually ~/.rake/*.rake ). -n --dry-run Do a dry run without executing actions. -p CODE --execute-print CODE Execute some Ruby code, print the result, then exit. -q --quiet Do not log messages to standard output. -r MODULE --require MODULE Require MODULE before executing rakefile. -s --silent Like --quiet, but also suppresses the 'in directory' announcement. -t --trace Turn on invoke/execute tracing, enable full backtrace. -v --verbose Log message to standard output (default). --rules Trace the rules resolution. SEE ALSO
ruby(1) make(1) http://rake.rubyforge.org/ REPORTING BUGS
Bugs, features requests and other issues can be logged at <http://onestepback.org/redmine/projects/show/rake>. You will need an account to before you can post issues. Register at <http://onestepback.org/redmine/account/register>. Or you can send an email to the author. AUTHOR
Rake is written by Jim Weirich <jim@weirichhouse.org> UNIX
November 7, 2012 UNIX
All times are GMT -4. The time now is 08:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy