![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| To call/execute a shell script from a shell script | konark | UNIX for Dummies Questions & Answers | 1 | 10-26-2007 02:16 PM |
| How to pass a parameter from one Shell-script to another Shell-script | subodhbansal | Shell Programming and Scripting | 2 | 09-22-2007 02:19 AM |
| How to Run a shell script from Perl script in Parent shell? | hifake | Shell Programming and Scripting | 16 | 08-28-2007 05:42 PM |
| Accessing variables of one shell script in another shell script | rsendhilmani | Shell Programming and Scripting | 1 | 04-30-2007 05:43 AM |
| Have a shell script call another shell script and exit | heprox | Shell Programming and Scripting | 2 | 11-20-2006 04:17 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Shell Script Help
Hi All,
I have a input file: hostnames.txt ssh,server1,user ssh,server2,user ssh,server3,user ssh,server4,user So can someone guide me as how to read this file and display the output as follow using a ksh. server1 server2 server3 server4 Thanks, |
| Forum Sponsor | ||
|
|
|
|||
|
Thanks to vgersh99, reborg, blowtorch that is exactly what I was trying to do. Now to continue with this..what I am trying to do is create an html link for each servername which will look like this in a txt file:
<a href="#server1">server1</a> <a href="#server2">server2</a> <a href="#server3">server3</a> and so on: I tried the following however it doesn't seem to be working. The output comes out to be one link instead of individual links. Can you guys provided some assistance with this. Thank you. Here is what I tried doing: hostFile = hostnames.txt hostlinks = `awk -F\, '{printf "%s ", $2}' $hostFile` printf "<a href=#$hostlinks>$hostlinks</a>" Obviously with this hostlinks output becomes one big link. |
|
|||
|
Hey versh99 thanks for the response. With this code from you I am almost there:
hostFile = hostnames.txt nawk -F, '{printf("<a href=#$hostlinks>%s</a>\n", $2)}' $hostFile however the above code is giving this link: http://singhb.hiw.com/hostusers/hostuserhtml.html#$hostlinks Can the $hostlinks variable be replace where it will show the actual server name. I tried replacing the $hostlinks with $2 however that only chnaged the html to: http://singhb.hiw.com/hostusers/hostuserhtml.html#$2 Thanks for your assistance with this. |
|||
| Google UNIX.COM |