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 > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Add Item to Dock 0.0.8 iBot UNIX and Linux RSS News 0 06-03-2008 05:10 AM
Add Item to Dock 0.0.7 iBot UNIX and Linux RSS News 0 01-24-2008 08:40 AM
find an available item in array fongthai Shell Programming and Scripting 4 07-16-2007 02:06 AM
Removing an item from the dock emperorfabulous Shell Programming and Scripting 1 12-31-2006 02:39 PM
Skip item by using substring rwunwla Shell Programming and Scripting 2 12-16-2005 01:12 PM

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 09-11-2007
happyv happyv is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 209
replace item..

Hello,
I have the following basic script which is remove the fielld. How can I replace another value in the field? Thx!!

for file in `cat $listn.txt`
do
get_file -q $file
grep -v '<customer-id>13000</customer-id>' $file > $file.grep
done
echo All processed file done!!

input file:
<customer-id>13000</customer-id>

output file:
<customer-id>2400</customer-id>

happyv

Last edited by happyv; 09-13-2007 at 01:04 AM..
  #2 (permalink)  
Old 09-13-2007
happyv happyv is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 209
anyone can help????
  #3 (permalink)  
Old 09-14-2007
Ygor's Avatar
Ygor Ygor is offline Forum Staff  
Moderator
  
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,407
Try...
Code:
sed 's!<customer-id>13000</customer-id>!<customer-id>2400</customer-id>!' $file > $file.sed
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 09:12 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