The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
serach file using awk mohan705 Shell Programming and Scripting 3 08-28-2007 11:04 AM
Replace path in a file with dot njoshi Shell Programming and Scripting 3 04-23-2007 09:37 PM
Replace a Directory path with another in a file venkatajay_18 Shell Programming and Scripting 3 10-17-2006 03:52 PM
vi - replacing a relative path with absolute path in a file Yinzer955i UNIX for Dummies Questions & Answers 2 09-07-2006 11:47 AM
text serach in unknown file ted UNIX for Advanced & Expert Users 11 10-23-2003 03:20 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-12-2007
kiranreddy1215 kiranreddy1215 is offline
Registered User
  
 

Join Date: Nov 2007
Location: SA
Posts: 12
serach and replace file name in the path in a remote xml file

hi every one ,

here is my problem !!

i have to run my script from an account and update the result in a xml file located on a different account. i use existing ssh keys to do it remotely

for example the tags looks like this


<PropertyValueList DeploymentName="Generic" NodeName="Generic" AppServerName="Generic">

<PropertyValue PropertyName="ProductCatalogBinaryFile">
<Value>/app/tsa/tsausr1_wb154/tsa/oms/ete3oms/OMSTSA_v06.00_1/OMS/pcdump/PcDump_06Nov_MAX_FT_80008.bin</Value>


i need to serach the PcDump_06Nov_MAX_FT_80008.bin file and update with the new filename, am having with me say for example PcDump_10Nov_MAX_FT_80008.bin

but the catch is ,
the absolute path mentioned above changes from one account to another , and also the file names
the file name pattern is same in every account like this PcDump_xxxxx_MAX_FT_xxxxxx.bin

thanks in advance

Last edited by kiranreddy1215; 11-12-2007 at 09:30 AM..
  #2 (permalink)  
Old 11-12-2007
awk awk is offline
Registered User
  
 

Join Date: Feb 2007
Posts: 134
Something like
sed 's|/PcDump_[0-9][0-9][A-Z][a-z][a-z]_MAX_FT_[[0-9][0-9][0-9][0-9][0-9].bin|/PcDump_10Nov_MAX_FT_80008.bin|g' <input xml>

Wouldn't it be easier to cp the PCDump*.txt file to a standard input file name, and code for that name permanently?
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:11 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0