Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

html and ksh how to

Status
Not open for further replies.

axelsche

MIS
Sep 5, 2001
53
DE
Hi Experts,

here is what I do right now:

<p>Hostname(s) where Printer should be installed:<br>
<select name="TOHOST" size="5">
<option> hsysap80 </option>
<option> hsysap81 </option>
<option> hsysap20 </option>
<option> hsysap21 </option>
<option> hsysap22 </option>
</select>
</p>

but what I really want to do is to get the options from a file or command output. I'm on a UNIX Box...

Appreciate any ideas
TIA
Axel
 
hmmm... all the page must be created using the ksh script...

start the shell with the following:

Code:
#!/bin/ksh  (or whatever it is)
printf "Content-type: text/html\n\n"
echo "<html><head></head>"
echo "<body>"

... you page here..
...

echo '<select name="TOHOST" size="5">'
cat list_options.txt | awk '{print "<option> $0 </option>"
echo "</select>"
echo "</body></html>"

the *printf "Content-type: text/html\n\n"* is mandatory.

chmod 555 file_page.cgi
 
The awk part should be changed to something like
[tt]
awk '{print "<option> " $0 " </option>"}'
[/tt]
 
oops, sorry, you are right futurelet, I should complete the awk line..
thanks!
 
Hi Chacalinc and futurelet,

thank you for the help.....
 
Code:
[s]cat list_options.txt | [/s]
awk '{print "<option> " $0 " </option>"}' [b]list_options.txt[/b]
:)

--------------------

Denis
 
UUOC police is watchin' you!

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
UUOC

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
I've been on a similar mission to get people to stop using backticks in favor of the more readable, more nestable $( ... ) construct. It's going about as well as Randall's campaign.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top