Sponsored Content
Top Forums Shell Programming and Scripting find and replace a path with sed? Post 302692001 by JC_1 on Monday 27th of August 2012 12:59:19 AM
Old 08-27-2012
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:
Code:
for i in $(ls)
do
sed -e 's:"/subjects/grin.*":"/subjects/$i.*":g'

and several variants with no luck. Please help. Thanks!

Last edited by Franklin52; 08-27-2012 at 04:38 AM.. Reason: Please use code tags for data and code samples
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replace a filename with full path using sed

hi, i need to replace a line a file with a new raw device location.. original file.. /opt/sybase/ASE1502/ASE-15_0/bin/dataserver \ -d/data/TST_AKS1/sybdevices/master.dat \ -e/logs/sybase/TST_AKS1/SFO_TST_AKS1.log \ -c/apps/sybase/ASE1502/ASE-15_0/TST_AKS1.cfg \... (2 Replies)
Discussion started by: aksaravanan
2 Replies

2. Shell Programming and Scripting

Help with find and Replace using sed

I have to update a paramater (dateMemLimit) present in a file, with a date (YYYYMMDD) equal to 5 days before the sysdate. The parameter will be in the following format. dateMemLimit = 20091201 Please note the blank spaces present between 'dateMemLimit' &'=' and between '='... (4 Replies)
Discussion started by: rajesh8s
4 Replies

3. 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

4. Shell Programming and Scripting

find and replace with SED

Hello all I have a file with a lot of records...Each one have a ID like this: 000000001 LDR L -----nam--2200217Ia-45e0 000000001 891 000000001 892 000000001 893 and so on then you have the second record: 000000002 LDR L -----nam--2200208Ia-15e0 000000002 891 000000002... (5 Replies)
Discussion started by: ldiaz2106
5 Replies

5. Shell Programming and Scripting

find and replace with sed

Hi, I have two files file1 :> val="10" port="localhost:8080" httpadd="http:\\192.168.0.239" file2 :> val=${val} port=${port} httpadd=${httpadd} fileloc=${fileloc} file3(or file2) should have following output(input from fileone) file3 (8 Replies)
Discussion started by: nitin.pathak
8 Replies

6. 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

7. Shell Programming and Scripting

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: Search_path=/search/path replace_path=/replace/path I used the following command but not usefull, please help me regarding the same. sed 's_/search/path_/replace/path_' file_name >... (6 Replies)
Discussion started by: nsyed.dw
6 Replies

8. Shell Programming and Scripting

Find and Replace with sed

Hi, I have a file such that: tart*)*98'bank'ksb64bank)(tart2d&f44bank I want to replace to: (only between tart and bank) tart*)*98'replaced'ksb64bank)(tart2d&f44replaced Thanks. (6 Replies)
Discussion started by: tara123
6 Replies

9. Shell Programming and Scripting

Find and replace using sed

Hi All, I have a file as shown below: myFile.dat #---------------------------------------------------------- dataFile { Name shiva; location Delhi; travelID IDNumber; } 4 ( 560065 700007 100001 200002 )... (8 Replies)
Discussion started by: linuxUser_
8 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
TM::PSI(3pm)						User Contributed Perl Documentation					      TM::PSI(3pm)

NAME
TM::PSI - Topic Maps, PSI (published subject identifiers) DESCRIPTION
This package provides predefined subjects, all of which will be preloaded in every map which is instantiated with the TM package hierarchy. When the subjects are defined also their relationship are kept here (example: isa is an instance of an assertion). Every such subject is defined by its item identifier The internal identifier, which does not really mean much. subject identifier The subject indicator(s), which is ultimately the one which identifies any of the subjects here. NOTE: For none of the subjects declared here a subject address exists. All concepts are TM-related concepts. The subjects are sorted: TMRM-related These are the minimal subjects which make a map what it is. Examples are "isa" and its related role (type) "class" and "instance", and "is-subclass-of" and its related roles. TMDM-related (XTM things) These are the additional concepts which are mandated by TMDM. AsTMa-related Here are more concepts which are needed by the AsTMa= language(s), such as "template" or "ontology". TMQL-related Here are more concepts which are needed by TMQL. To learn about these predefined concepts, you can do one of the following use TM::PSI; warn Dumper ($TM::PSI::core, $TM::PSI::topicmaps_inc, $TM::PSI::astma_inc, $TM::PSI::tmql_inc); Taxonometry Two association types are predefined by the standard(s): "is-subclass-of" and "isa". Together with these roles are defined "subclass", "superclass" and "instance", "class", respectively. The TM::* suite of packages has these not only built in, but also works under the assumption that these association types and also the roles CANNOT be subclassed themselves. This means that no map is allowed to use, say, "is-specialization-of" as a subclass of "is-subclass-of". The costs of this constraint is quite small compared to the performance benefits. Infrastructure Concepts To make the whole machinery work, every topic map must contain infrastructure topics such as "name", "occurrence" etc. They are topics like the topics a user may put into the map. While this is the right thing to do, in practical situation you often will want to filter out these infrastructure topics. You can always get a list of these via @@@ fix docu @@@@@ $tm->mids (keys %{$TM::PSI::topicmaps->{mid2iid}}); SEE ALSO
TM AUTHOR INFORMATION
Copyright 200[1-68], Robert Barta <drrho@cpan.org>, All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. http://www.perl.com/perl/misc/Artistic.html perl v5.10.1 2010-07-18 TM::PSI(3pm)
All times are GMT -4. The time now is 05:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy