Sponsored Content
Top Forums Shell Programming and Scripting Print all Host on local network Post 302679497 by gull04 on Tuesday 31st of July 2012 05:31:45 AM
Old 07-31-2012
Hi,

You can try this;

Code:
$ for ip in `echo '[1+pd254>aq]sa0 1-lax' | dc`; do ping -c 1 10.176.128.$ip>/dev/null; [ $? -eq 0 ] && echo "10.176.128.$ip UP" ; nslookup 10.176.128.$ip || : ; done

Where the XXX.XXX.XXX is your first three octets.

Regards

Dave

Last edited by gull04; 07-31-2012 at 06:32 AM.. Reason: Typo
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

local host setup

I am running Redhat 7.2. I am using a router with dhcp setup for my computer. When logging in, I get the error "dhcppc1 not found". My router assigned that host name to my pc for dhcp. It says to modify the /etc/hosts file to keep from having any problems. Everything seems to be working ok... (2 Replies)
Discussion started by: jeremiebarber
2 Replies

2. UNIX for Advanced & Expert Users

sendmail : connect local host (brocken)

hi there I've got a strange problem with a webserver box (suse linux 7.2). My MTA is sendmail, and when I tried manually send a mail. Sendmail -v "user@something" < /etc/hosts The Server tried "simon@localhost... Connecting to local..." but nothing happend and the system hold on. This... (3 Replies)
Discussion started by: mrsaint
3 Replies

3. UNIX for Dummies Questions & Answers

local host

Dear Guys , Please again , i could not find a solution for my server linux red hat 9 . when i leave it about more than 5 min ideal it goes to something like sleep mode and all services stop and even TCP/IP .. what shall i do ??? another thing please , when i installed the server , i gave... (3 Replies)
Discussion started by: tamemi
3 Replies

4. Solaris

How to delete the files from local host to remote host

Hi all, i am copying .gz files from production server to development server using "scp" command.my requirement is after copying .gz files i want to delete old .gz files(two days back) in development server from production server. like this way i need to delelte .log ,.z and .dmp files... (3 Replies)
Discussion started by: krishna176
3 Replies

5. IP Networking

ssh server is attachable from local network not from another network

hello i have a ubuntu ssh server that i can acess from any of my comnputers but only if they are on the same wireless network as the server. i tested trhis my tehtehring my samsung blackjack to my windows partition and installing openssh to windows it works when windows is on the wireless but no... (1 Reply)
Discussion started by: old noob
1 Replies

6. UNIX for Advanced & Expert Users

Help! How to find the local host after few ssh hops to remote host???

I do a ssh to remote host(A1) from local host(L1). I then ssh to another remote(A2) from A1. When I do a who -m from A2, I see the "connected from" as "A1". => who -m userid pts/2 2010-03-27 08:47 (A1) I want to identify who is the local host who initiated the connection to... (3 Replies)
Discussion started by: gomes1333
3 Replies

7. Shell Programming and Scripting

ssh to multiple hosts and saving the output in the local host

hi I have a script to login from a host "A" to a list of hosts in a file and perform some commands inside it...its somethin like this for i in `cat file` do ssh -t $i " command1 ; command2; ..." done I wanna save the outputs in a file in the current host "A" i.e from where I am... (3 Replies)
Discussion started by: ningy
3 Replies

8. Shell Programming and Scripting

Copy a file from local host to a list of remote hosts --- perl script

Hi friends, i need to prepare a script ( in perl) i have a file called "demo.exe" in my local unix host. i have a list of remote hosts in a file "hosts.txt" now i need to push "demo.exe" file to all the hosts in "hosts.txt" file. for this i need to prepare a script(in perl, but shell... (5 Replies)
Discussion started by: siva kumar
5 Replies

9. Shell Programming and Scripting

Set variable to path that does not exist on local host

Can anyone suggest a workaround zone_5.org='/qaz/qwe/path/tns.osn' output /home/bingo/XXX_script.sh: line 180: zone_5.org=/qaz/qwe/path/tns.osn: no parent The path does not exist on the local machine, the allocation used to work till the server was upgraded. Red Hat Enterprise Linux... (2 Replies)
Discussion started by: squrcles
2 Replies

10. Shell Programming and Scripting

Copy local files to single remote host but multiple folders using rsync

I'm trying to copy a file myfile.scr from my local Linux server to multiple folders on remote AiX server using single rsync command. Below command helps me copy the file "myfile.scr" from my localhost to a remote host folder "/app/deployment/tmpfiles" rsync --delay-updates -F --compress... (1 Reply)
Discussion started by: mohtashims
1 Replies
hostid(1)						      General Commands Manual							 hostid(1)

NAME
hostid - Sets or displays the identifier of the local host SYNOPSIS
/usr/sbin/hostid [hostname | hexadecimal_number | internet_address] DESCRIPTION
The hostid command displays the 32-bit identifier of the host as a hexadecimal number in host standard byte order. The identifier must be unique across all hosts and is commonly set to the Internet address of the specified host. The superuser can set the host ID by specifying a hostname, internet_address, or hexadecimal_number argument. The identifier is stored in network standard byte order. EXAMPLES
To display the identifier of the local host, enter: $ hostid 0xc009c803 The hostid command displays the identifier of the host as a hexadecimal number in host standard byte order. To set the identifier of the local host to the local Internet address, enter: $ hostid 555.5.55.555 The hostid command converts the Internet address to its hexadecimal equivalent, and then sets the local host to this address. Note that the sample Internet address in this example, 555.5.55.555, is not a valid Internet address and would cause hostid to return an error. SEE ALSO
Commands: hostname(1) Functions: gethostid(2), sethostid(2) hostid(1)
All times are GMT -4. The time now is 05:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy