shell script to change ip addess to 0.0.0.0 from 172.29.1.1 to 17.29.2.245


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting shell script to change ip addess to 0.0.0.0 from 172.29.1.1 to 17.29.2.245
# 1  
Old 07-01-2009
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  
Old 07-01-2009
use this sed
Code:
sed 's/\(172\.29\.[0-9]*\.[0-9]*\)\(.*\)/0.0.0.0\2/g' filename

Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script to change the ip

I am writing a simple DHCP server application that gets ip from a server at boot up ! i wrote a shell script to run the java program that obtains ip from server on another machine... The problem is when i have obtained the ip i store it in a file ! using awk i retrieve the... (1 Reply)
Discussion started by: dinesh17
1 Replies

2. Shell Programming and Scripting

Wants to change shell script into crontab

Hi friends, Actually i wrote many scripts in korn shell for time saving activity in storage domain. But every week i am spending some time for the running of script. So every Monday i wants to run my scripts automatically. So corn will be helpful according to my friend's opinion. But I don't... (5 Replies)
Discussion started by: Mahendranath
5 Replies

3. Shell Programming and Scripting

Change crontab from shell script

Hi All, I have scheduled a script to run every five minutes through crontab. If there is any issue with the script which may need manual intervention, I have used the mailx commands. But at the same time, I would want the cron to be disabled until the issue is resolved. Once things are fine,... (2 Replies)
Discussion started by: adi_2_chaos
2 Replies

4. Shell Programming and Scripting

Shell Script to change a user password using script

Hi Experts, I had tried to executes this script to change the user password through script: No lines in buffer #!/bin/ksh cat /etc/passwd | grep -v userid >> /tmp/pass.tmp1 cat /etc/passwd | grep userid >> /tmp/pass.tmp2 PASS1=`cat /tmp/pass.tmp2 | cut -d ":" -f2` PASS2=`q2w3e4r5` sed... (3 Replies)
Discussion started by: indrajit_renu
3 Replies

5. Shell Programming and Scripting

Change the Windows Batch script to UNIX shell script.

Hi, When I run the below script in UNIX it's throwing syntax errors. Actually it's a windows batch script. Could anyone change the below Windows Batch script to UNIX shell script... Script: REM :: File Name : Refresh_OTL.bat REM :: Parameters : %1 - Region REM :: : %2 - Cube Type REM ::... (5 Replies)
Discussion started by: tomailraj
5 Replies

6. Shell Programming and Scripting

Shell script to change a value

I have a shell script that has following entry. MEM_ARGS="-Xms256m -Xmx512m" export MEM_ARGS if ; then if ; then MEM_DEV_ARGS="-XX:CompileThreshold=8000 -XX:PermSize=48m " export MEM_DEV_ARGS fi fi # Had to have a separate test here... (3 Replies)
Discussion started by: rijeshpp
3 Replies

7. Post Here to Contact Site Administrators and Moderators

Received all post on my mail addess

Hi neo, I am a resistered member of Forum. I want to received all post which posted by all members via mail address. Can this possible to me??? Can i receive all posts?? Thanks Yogesh Goyal (0 Replies)
Discussion started by: yogesh goyal
0 Replies

8. Shell Programming and Scripting

Change Password In A Shell Script

Hi All, I have a problem. I need to write a shell script to change the password. The user may want to change his own password by this script. He will have to provide the required 3 parameters i.e. old password, new password and retype new password as arguments in command line. like,... (6 Replies)
Discussion started by: pintu_asim
6 Replies
Login or Register to Ask a Question