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
Shell script to change a value rijeshpp Shell Programming and Scripting 3 05-19-2009 12:18 PM
Change directory in a shell script laxmi Linux 12 01-17-2008 08:07 AM
change directory using shell script laxmi Shell Programming and Scripting 0 01-17-2008 07:12 AM
Change Password In A Shell Script pintu_asim Shell Programming and Scripting 6 06-29-2006 10:16 AM
change user through shell script raviraushanjha UNIX for Dummies Questions & Answers 0 12-12-2005 03:11 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-01-2009
pankajd pankajd is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 18
shell script to change ip addess to 0.0.0.0 from 172.29.1.1 to 17.29.2.245

hello,
i have a file in which lines like this are to ve replaced with lines like

{172.29.1.55 mn55.mgmt.yuva.param # }should change to
{0.0.0.0 mn55.mgmt.yuva.param #noconn
Fallowing are the lines example lines are in a file in the same sequence to be converted :
172.29.1.49 mn49.mgmt.yuva.param #cpu
172.29.1.82 mn82.mgmt.yuva.param #
172.29.1.100 mn100.mgmt.yuva.param #
172.29.2.17 mn271.mgmt.yuva.param #
172.29.2.24 mn278.mgmt.yuva.param #
  #2 (permalink)  
Old 07-01-2009
vidyadhar85's Avatar
vidyadhar85 vidyadhar85 is offline Forum Staff  
Moderator(The Tutor)
  
 

Join Date: Jun 2008
Location: INDIA
Posts: 1,389
use this sed
Code:
sed 's/\(172\.29\.[0-9]*\.[0-9]*\)\(.*\)/0.0.0.0\2/g' filename
Sponsored Links
Reply

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 11:55 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
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