I have a requirement where i have to globally remove a hosts file entry from all boxes e.g.
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 ?
Can anyone provide me a shell script to edit a xml file and delete one entry.
To do manually i can edit(vi editor) the file and 'dd' will delete the file.But I wiluld to know if I can do with a script.
Thanks in advance
Tannu (6 Replies)
Hello I want to block individuals who attempt to use ssh to loggon to one of my machines from a certain IP address. I added the following entry in hosts.deny. Will the entry do what I want to do?
ssh: 202.111.128.225 (3 Replies)
Hello all,
I´m on Red Hat Enterprise Server 4.5
I´m wondering if it is possible to disable the need to add every IP machine entry in the file /etc/hosts to allow it to connect to Red hat?
I´m getting "where are you?" message. This is solved adding the machine ip where I´m working.
Thanks in... (1 Reply)
I have a unique situation here which looks easier at first but I am not able to solve it.
# SSort UNIX 10/14/2005 10/13/2010 "tox" "9000/800" 16 * * * V849-6-1
# SSort UNIX 11/31/1996 11/02/2010 "tox" "9000/800" 16 * * * W237-S-2
I have a text file with two or multiple values like this and... (1 Reply)
Hi all,
I have an entry in my hosts file on a server called tractor as follows:
10.67.34.128 digger-m2m digger
I have a DNS server configured but it doesn't seem to know about digger. When I do an nslookup on tractor for digger i get the following:
new_dns1.oam.uk can't find digger: Non... (0 Replies)
Hi *,
I need to delete duplicate lease entries in file according to MAC/IP.
I'm having tempfile which contains many lease info and need to have one entry for each IP(not more than that), if it contains more than one entry for same set, need to be deleted that entry...
EX:
lease... (4 Replies)
Hello UNIX gurus,
I noticed this file or whatever in one of our directories, and somehow I am not able to proceed with my work, without deleting this one.
.insert--- 1 siebload intrface 0 Feb 22 01:25 Testfile
I am confused, as it doesnt appear to be a file, and on doing any... (2 Replies)
Hi Gurus,
I am trying to connect to remote host from current host to check crontab entries. I have started like this
ssh -n -l db2psp 205.191.156.17 ". ~/.profile >/dev/null 2>/dev/null; cd log ;ls | wc -l"
I got this error ?
ssh: connect to host 205.191.156.17 port 22:... (1 Reply)
Hi All,
Please help me and guide me to write a bash/shell script on Linux box to delete parent entry with all their child entries.
example:
Parent is :
----------
dn: email=yogesh.kumar@wipro.com, o=wipro, o=in
child is:
----------
dn: cn: yogesh kumar, email=yogesh.kumar@wipro.com,... (1 Reply)
Am trying to copy a tar file onto a series of remote hosts and untar it at the destination. Need to do this without having to do multiple ssh.
Actions to perform within a single ssh session via shell script
- copy a file
- untar at destination (remote host)
OS : Linux RHEL6 (3 Replies)
Discussion started by: sankasu
3 Replies
LEARN ABOUT OSX
makedbm
MAKEDBM(8) BSD System Manager's Manual MAKEDBM(8)NAME
makedbm -- create a YP database
SYNOPSIS
makedbm -u file
makedbm -U file
makedbm [-bls] [-i yp_input_file] [-o yp_output_file] [-d yp_domain_name] [-m yp_master_name] infile outfile
DESCRIPTION
Makedbm is the utiliy in YP that creates the database file containing the YP map. The databse format is a slightly modified version of ndbm.
The options are as follows:
-u Dump a database to standard output.
-U Same as -u but also try db(3) hash format.
-b Interdomain. Include an entry in the database informing a YP server to use DNS to get information about unknown hosts. This option
will only have effect on the two maps hosts.byname and hosts.byaddr.
-l Lowercase. Convert all keys to lower case before adding them to the YP database.
-s Secure map. Include an entry in the database informing ypxfr(8) and ypserv(8) that the YP map is going to be handled as secure.
-i yp_input_file
Include an entry the in the map with the key YP_INPUT_FILE and the argument as value.
-o yp_output_file
Include an entry the in the map with the key YP_OUTPUT_FILE and the argument as value.
-d yp_domain_name
Include an entry the in the map with the key YP_DOMAIN_NAME and the argument as value.
-m yp_master_name
Include an entry the in the map with the key YP_MASTER_NAME and the argument as value.
SEE ALSO yp(8), db(3), ypxfr(8), ypserv(8)AUTHOR
Mats O Jansson <moj@stacken.kth.se>
BSD July 19, 1994 BSD