![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 edit file and delete entry | tannu | Shell Programming and Scripting | 6 | 09-09-2008 04:04 PM |
| userpw.h AIX ( delete entry from the shadow password database ) | nighter | High Level Programming | 4 | 07-15-2008 03:06 PM |
| delete dhcp.conf entry using sed | tizatron | Shell Programming and Scripting | 2 | 11-26-2007 05:59 PM |
| HOSTS File | cymerman | UNIX for Dummies Questions & Answers | 4 | 01-19-2007 12:26 PM |
| how to delete entry in file "wtmpx"(/var/adm/wtmpx) | arm_naja | UNIX for Advanced & Expert Users | 4 | 03-08-2006 04:00 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
delete entry from /etc/hosts file ?
Hi there I have a requirement where i have to globally remove a hosts file entry from all boxes e.g. Code:
10.01.10.1 my_server1 normally for 'in-line' editing of files without passing it out to another fle and copying it back etc which is messy, Ive been using the fantastic "perl -pi -e" substitution command. However in this case I want to literally delete the line which im not sure that the perl command can do ? But ....two things I want to make sure i delete the line ONLY if both the ip AND the hostname are as defined (so that i know im deleting only this line) and the gap between the IP and hostname within the hosts file is variable with any potential number of spaces or tabs in between the two Does anybody have an idea on how i can achieve this ? Any help on this would be great |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|