![]() |
Hello and Welcome from 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 |
| How to attach a file in a email | ting123 | UNIX for Dummies Questions & Answers | 3 | 04-11-2009 07:03 PM |
| hi.. how to attach a tar file using shell script | madhumathikv | Shell Programming and Scripting | 1 | 10-17-2007 07:46 AM |
| Howto Attach File with Sendmail | monkfan | UNIX for Dummies Questions & Answers | 2 | 05-18-2006 09:43 AM |
| How to attach an excel file/ dat file thru unix mails | diwakar82 | Shell Programming and Scripting | 1 | 01-06-2006 11:23 AM |
| How to attach a file in mail? | firebirdonfire | UNIX for Dummies Questions & Answers | 1 | 03-29-2001 08:38 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
how to assign the value from the 2nd file to the 1st file, line by line..
Hi all,
I am a newbie in unix shell script world. Say, I have a list of devices in file01 and then also have file02 with the list of the location. I need to telnet to each devices in file01 and set the location according to file02. Example: #cat file01 ttnpx01 ttnpx02 nncrd01 nncrd02 nkcrs01 #cat file02 liverpool newtown stockland greenfield newyork With the for loop I can telnet to each device from file01, but I am not sure how to retrieve the variable from file02 and then attach to device. This is my basic script #cat myscript for host in `cat file01` do telnet $host set location ... done Below is the result that I try to achieve: ttnpx01 --> will have the location set to liverpool ttnpx02 --> will have the location set to newtown nncrd01 --> will have the location set to stockland nncrd02 --> will have the location set to greenfield nkcrs01 --> will have the location set to newyork Can you please help? Thanks Last edited by lo tan; 05-31-2008 at 09:22 AM.. |
|
||||
|
Quote:
I have tried your code, it works fine with a linux machine. However, when I tried it with a SunOS, it failed due to the awk could not combine 2 files side by side. As a newbie I am still in learning process and have not much experiences with the awk, would you able to lend me a hand please? Below is the result from the awk and I think it is not what you meant. Thanks #awk 'NR==FNR{a[NR]=$0;next}{print a[FNR], $0}' file01 file02 ttnpx01 ttnpx02 nncrd01 nncrd02 nkcrs01 liverpool newtown stockland greenfield newyork |
|
||||
|
Quote:
Regards |
![]() |
| Bookmarks |
| Tags |
| linux |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|