![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
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 |
| wget output question | sertansenturk | UNIX for Dummies Questions & Answers | 1 | 04-19-2008 01:01 PM |
| display and output...question | happyv | Shell Programming and Scripting | 5 | 01-25-2007 02:14 AM |
| Question on prtdiag output ... | luft | UNIX for Dummies Questions & Answers | 5 | 11-14-2006 12:27 PM |
| A question about output. | HOUSCOUS | High Level Programming | 2 | 04-18-2003 01:48 PM |
| Further question on 'ifconfig' output | mint1981 | UNIX for Dummies Questions & Answers | 1 | 09-10-2002 12:49 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Question about output to file
Hi,
I am try to setup a FOR loop script to find out all the existing linux workstations in the network w/ ip address, hostname and linux version. I created a basic FOR loop script: for i in $(seq 1 254) do echo 10.72.169.$i >> result ssh -o ConnectTimeout=3 root@10.72.169.$i "hostname" >> result ssh -o ConnectTimeout=3 root@10.72.169.$i "cat /etc/redhat-release" >> result done However, the output is like this: . . 10.72.169.21 lumines.devo.ilx.com Fedora Core release 5 (Bordeaux) 10.72.169.22 10.72.169.23 10.72.169.24 copper.devo.ilx.com 10.72.169.25 frogger.devo.ilx.com Fedora Core release 5 (Bordeaux) 10.72.169.26 afterlife.devo.ilx.com Red Hat Linux release 9 (Shrike) 10.72.169.27 10.72.169.28 molybdenum Red Hat Linux release 9 (Shrike) 10.72.169.29 Red Hat Linux release 7.2 (Enigma) 10.72.169.30 . . . I want the output to be like (with ip address, then hostname, then version) : 10.72.169.21 lumines.devo.ilx.com Fedora Core release 5 (Bordeaux) 10.72.169.22 abc.devo.ilx.com Fedora Core release 5 (Bordeaux) . . I think with the command AWK, i don't know how to do that. Can someone show it to me? Thanks BEELOO |
|
||||
|
It's against the:
Simple rules of the UNIX.COM forums: to double posts questions, continue here: Question relate to AWK Thread closed. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|