Welkom op de Nederland Computer Kennisnetwerk!  
 
Zoeken computer kennis
Home Hardware Netwerken Programmering Software Computerstoring Besturingssysteem
Computer Kennis >> Besturingssysteem >> unix >> Content
Hoe maak je een UNIX Shell Script om een HTML- webpagina Maak
UNIX shell scripts kunnen worden gebruikt om webpagina's die de output van de fundamentele UNIX commando's weer te geven , zoals " uname - a " en maak " uptime , " of complexe programma's . Dit type script wordt een gemeenschappelijke toegangspoortinterface script wordt gebruikt om te communiceren met de werkelijke webserver en produceren dynamische inhoud op de webpagina . UNIX shell scripts kunnen alleen worden gebruikt op Linux - of UNIX - gebaseerde webservers . Instructies
1

Open een teksteditor zoals vi , nano of gedit . Kopen van 2

Typ de regel " # ! /Bin /bash " zonder aanhalingstekens om te beginnen de shell script . Elke output van dit script zal naar de browser worden verzonden als onderdeel van de server HTTP response

Type 3 de volgende regel toe aan de HTTP- header die aangeeft dat HTML volgt vastgesteld : .

echo " Content-type : text /html "

Type 4 de regel " echo " zonder aanhalingstekens om een ​​lege regel in te voegen op de headers , die het script ervan weerhoudt terug te voltooien een misvormde kop fout wanneer het wordt uitgevoerd op de webserver
5

Typ het volgende aan de sectie HTML header uitvoeren en beginnen met het hoofdgedeelte van de pagina : .

echo
" Test Script < /title > < /head > <body> " <br> <p> Type 6 de volgende twee regels aan de run" uname - a " en " uptime " commando's en het formaat van de output voor de webpagina : <p> echo <br> " Output van uname - a : <pre> ` uname - a ` < /pre > < br /> " echo " Output van uptime : <pre> ` uptime ` < /pre > <br /> " <br> <p> De backtick wordt gebruikt om de uitvoer van de opdracht substitutie uit te voeren tijdens het bellen echo . <br> <p> Type 7 de volgende regel om de webpagina te voltooien : <p> echo <br> " < /body > < /html > " <br> 8 <p > Sla het bestand met de extensie. cgi bestandsextensie . <br> 9 <p> Plaats het bestand in de map die uw webserver gebruikt voor CGI- scripts . Deze directory wordt vaak genoemd cgi of cgi - bin . <br> <br></td> </tr> </table> <table border=0 cellSpacing=0 cellPadding=0 width=970 align=center height=90> <tr> <td bgColor=#e7edf4 align=middle><script language='javascript' src='/ad/201310/3.js'></script></td> </tr> </table> <table border=0 cellSpacing=0 cellPadding=0 width=970 align=center height=90> <tr> <td align=left>Previous: <a class='LinkPrevArticle' href='/besturingssysteem/unix/201309/211932.html' >Hoe maak je een Unix shell script schrijven om afdrukken van een lijst op een nieuwe regel </a></li> </td> <td align=right>Next: <a class='LinkNextArticle' href='/besturingssysteem/unix/201309/211934.html' >Hoe maak je een Unix -bestand met een datumstempel </a></li> </td> </tr> </table> </td> </tr> </table> <table border=0 cellSpacing=0 cellPadding=0 width=970 align=center height=18> <tr> <td></td> </tr> </table> <table border=0 cellSpacing=0 cellPadding=0 width=970 align=center height=246> <tr> <td height=246 vAlign=top width=199> <table class=bian border=0 cellSpacing=0 cellPadding=0 width=199> <tr> <td height=244 vAlign=top width=197> <table border=0 cellSpacing=0 cellPadding=0 width="100%" bgColor=#dbe3ee> <tr> <td height=29 width="4%"> </td> <td width="96%"><STRONG>unix</STRONG></td> </tr> </table> <table width="100%" cellpadding="0" cellspacing="0"><tr><td width="10" valign="top" class="">·</td><td class=""><a class="" href="/besturingssysteem/unix/201309/211931.html" title="Hoe je tekst zoeken binnen bestanden op Unix " target="_self">Hoe je tekst zoeken binnen bes…</a></td></tr><tr><td width="10" valign="top" class="">·</td><td class=""><a class="" href="/besturingssysteem/unix/201309/211854.html" title="Hoe te Shut Down in SCO Unix 5.0 " target="_self">Hoe te Shut Down in SCO Unix 5…</a></td></tr><tr><td width="10" valign="top" class="">·</td><td class=""><a class="" href="/besturingssysteem/unix/201309/211880.html" title="Hoe maak je een GZ -bestand in Unix Unzip " target="_self">Hoe maak je een GZ -bestand in…</a></td></tr><tr><td width="10" valign="top" class="">·</td><td class=""><a class="" href="/besturingssysteem/unix/201309/211916.html" title="Hoe maak je een script bestand op Maak Unix " target="_self">Hoe maak je een script bestand…</a></td></tr><tr><td width="10" valign="top" class="">·</td><td class=""><a class="" href="/besturingssysteem/unix/201309/211806.html" title="Hoe maak je verbinding een directe UNIX NDM " target="_self">Hoe maak je verbinding een dir…</a></td></tr><tr><td width="10" valign="top" class="">·</td><td class=""><a class="" href="/besturingssysteem/unix/201309/211871.html" title="Pros & Cons van het Unix besturingssysteem " target="_self">Pros & Cons van het Unix bestu…</a></td></tr><tr><td width="10" valign="top" class="">·</td><td class=""><a class="" href="/besturingssysteem/unix/201309/211924.html" title="" Tar.gz . " Files hoe je een tar.gz Unzip Unix File " target="_self">" Tar.gz . " Files hoe je een …</a></td></tr><tr><td width="10" valign="top" class="">·</td><td class=""><a class="" href="/besturingssysteem/unix/201309/211950.html" title="Unix Command Tutorial " target="_self">Unix Command Tutorial </a></td></tr><tr><td width="10" valign="top" class="">·</td><td class=""><a class="" href="/besturingssysteem/unix/201309/211804.html" title="Hoe kan ik een gebruiker toe aan Unix " target="_self">Hoe kan ik een gebruiker toe a…</a></td></tr><tr></tr></table></td> </tr> </table> </td> <td vAlign=top width=12></td> <td vAlign=top width=375> <table class=bian border=0 cellSpacing=0 cellPadding=0 width=375> <tr> <td height=244 vAlign=top> <table border=0 cellSpacing=0 cellPadding=0 width="100%" bgColor=#dbe3ee> <tr> <td height=29 width="4%"> </td> <td width="96%"><STRONG>Related Articles</STRONG></td> </tr> </table> <table border=0 cellSpacing=4 cellPadding=0 width="95%" align=center height=209> <tr> <td height=201 width="33%"><IMG src="/img_xby/n1.jpg" width=111 height=182></td> <td width="67%"><a class='LinkArticleCorrelative' href='/besturingssysteem/windows-xp/201309/237436.html' target="_self">Hoe te Cool Bureaublad Achtergronden voo…</a><br><a class='LinkArticleCorrelative' href='/besturingssysteem/windows-xp/201309/237435.html' target="_self">Hoe maak je Windows XP Fonts Look Better…</a><br><a class='LinkArticleCorrelative' href='/besturingssysteem/windows-xp/201309/237434.html' target="_self">Hoe te bespoedigen Windows XP </a><br><a class='LinkArticleCorrelative' href='/besturingssysteem/windows-xp/201309/237433.html' target="_self">Hoe je Auto Login inschakelen in Windows…</a><br><a class='LinkArticleCorrelative' href='/besturingssysteem/windows-xp/201309/237432.html' target="_self">Hoe je Auto Login inschakelen in Windows…</a><br><a class='LinkArticleCorrelative' href='/besturingssysteem/windows-xp/201309/237431.html' target="_self">Hoe te installeren Windows XP op uw comp…</a><br><a class='LinkArticleCorrelative' href='/besturingssysteem/windows-xp/201309/237430.html' target="_self">Hoe om te upgraden naar Vista uit Window…</a><br><a class='LinkArticleCorrelative' href='/besturingssysteem/windows-xp/201309/237429.html' target="_self">Hoe om bestanden in Windows XP Pro </a><br><a class='LinkArticleCorrelative' href='/besturingssysteem/windows-xp/201309/237428.html' target="_self">Hoe te File Type Associations in Windows…</a><br></td> </tr> </table> </td> </tr> </table> </td> <td vAlign=top width=8></td> <td vAlign=top width=376> <table class=bian border=0 cellSpacing=0 cellPadding=0 width=375> <tr> <td height=244 vAlign=top> <table border=0 cellSpacing=0 cellPadding=0 width="100%" bgColor=#dbe3ee> <tr> <td height=29 width="4%"> </td> <td width="96%"><STRONG>Besturingssysteem Articles</STRONG></td> </tr> </table> <table border=0 cellSpacing=4 cellPadding=0 width="95%" align=center height=207> <tr> <td height=199 width="33%"><IMG src="/img_xby/n2.jpg" width=111 height=182></td> <td width="67%"> <table width="100%" cellpadding="0" cellspacing="0"><tr><td width="10" valign="top" class="">·</td><td class=""><a class="" href="/besturingssysteem/windows/201309/219822.html" title="Hoe je verborgen Mailer -programma's verwijderen " target="_self">Hoe je verborgen Mailer -programma's ver…</a></td></tr><tr><td width="10" valign="top" class="">·</td><td class=""><a class="" href="/besturingssysteem/windows/201309/220725.html" title="Hoe te openen Explorer Window bij Max Maat " target="_self">Hoe te openen Explorer Window bij Max Ma…</a></td></tr><tr><td width="10" valign="top" class="">·</td><td class=""><a class="" href="/besturingssysteem/windows/201309/212284.html" title="Mijn Dell Dimension 4300 kwam niet met Setup CD " target="_self">Mijn Dell Dimension 4300 kwam niet met S…</a></td></tr><tr><td width="10" valign="top" class="">·</td><td class=""><a class="" href="/besturingssysteem/windows/201309/227569.html" title="Tips voor het Snijden Door & Window Behuizing " target="_self">Tips voor het Snijden Door & Window Behu…</a></td></tr><tr><td width="10" valign="top" class="">·</td><td class=""><a class="" href="/besturingssysteem/windows/201309/219202.html" title="Hoe te verwijderen van de Windows Search Tray " target="_self">Hoe te verwijderen van de Windows Search…</a></td></tr><tr><td width="10" valign="top" class="">·</td><td class=""><a class="" href="/besturingssysteem/windows/201309/223247.html" title="Ideeën om de zon te blokkeren van een Skylight " target="_self">Ideeën om de zon te blokkeren van een S…</a></td></tr><tr><td width="10" valign="top" class="">·</td><td class=""><a class="" href="/besturingssysteem/windows/201309/213965.html" title="Hoe uw computer Set Back One Day " target="_self">Hoe uw computer Set Back One Day </a></td></tr><tr><td width="10" valign="top" class="">·</td><td class=""><a class="" href="/besturingssysteem/basic-computer-skills/201309/202503.html" title="Hoe Sites op uw PC blokkeren " target="_self">Hoe Sites op uw PC blokkeren </a></td></tr><tr><td width="10" valign="top" class="">·</td><td class=""><a class="" href="/besturingssysteem/windows/201309/213361.html" title="Het automatisch laden Debugging in PHP " target="_self">Het automatisch laden Debugging in PHP </a></td></tr><tr></tr></table></td> </tr> </table> </td> </tr> </table> </td> </tr> </table> <table border=0 cellSpacing=0 cellPadding=0 width=970 align=center height=10> <tr> <td></td> </tr> </table> <table border=0 cellSpacing=0 cellPadding=0 width=970 align=center height=57> <tr> <td class=bs background=/img_xby/di.jpg align=center>Copyright © Computer Kennis http://www.nldit.com <script language='javascript' src='/ad/201310/5.js'></script></td> </tr> </table> <table border=0 cellSpacing=0 cellPadding=0 width=970 align=center height=10> <tr> <td></td> </tr> </table> </div> </body> </html>