×ðÁú¿­Ê±

ʹÓà Bash ÖÆ×÷ Web Çå¾²ÑÕÉ«

µ±ÅÌËã»úÏÔʾÆ÷µÄµ÷É«°åÓÐÏÞʱ £¬ÍøÒ³Éè¼Æʦͨ³£Ê¹ÓÃÒ»×é web Çå¾²ÑÕÉ« À´½¨ÉèÍøÕ¾¡£ËäÈ»ÔÚ½ÏÐÂ×°±¸ÉÏÏÔʾµÄÏÖ´úÍøÕ¾¿ÉÒÔÏÔʾ±È×î³õµÄ web Çå¾²µ÷É«°å¸ü¶àµÄÑÕÉ« £¬µ«ÎÒÓÐʱϲî³ØÚ½¨ÉèÍøҳʱ²Î¿¼ web Çå¾²ÑÕÉ«¡£ÕâÑùÎÒ¾ÍÖªµÀÎÒµÄÍøÒ³ÔÚÈκεط½¶¼¿´ÆðÀ´²»´í¡£

Äã¿ÉÒÔÔÚÍøÉÏÕÒµ½ Web Çå¾²µ÷É«°å £¬µ«ÎÒÏëÓµÓÐ×Ô¼ºµÄ¸±±¾ÒÔÀû±ã²Î¿¼¡£ÄãÒ²¿ÉÒÔʹÓà Bash ÖеĠfor Ñ­»·½¨ÉèÒ»¸ö¡£

Bash for Ñ­»·

Bash ÖÐµÄ for Ñ­»· µÄÓï·¨ÈçÏÂËùʾ£º

for ±äÁ¿ in ÜöÝÍ ; do Óï¾ä ; done

µÇ¼ºó¸´ÖÆ

ÀýÈç £¬¼ÙÉèÄãÏë´òÓ¡´Ó 1 µ½ 3 µÄËùÓÐÊý×Ö¡£Äã¿ÉÒÔ¿ìËÙÔÚ Bash ÏÂÁîÐÐÉϱàдһ¸ö for Ñ­»·À´ÎªÄãÍê³ÉÕâÏîÊÂÇ飺

$ for n in 1 2 3 ; do echo $n ; done123

µÇ¼ºó¸´ÖÆ

·ÖºÅÊDZê×¼µÄ Bash Óï¾äÍÑÀë·û¡£ËüÃÇÔÊÐíÄãÔÚÒ»ÐÐÖбàд¶à¸öÏÂÁî¡£ÈôÊÇÄãÒªÔÚ Bash ¾ç±¾ÎļþÖаüÀ¨Õâ¸ö for Ñ­»· £¬Äã¿ÉÒÔÓû»ÐзûÌæ»»·ÖºÅ²¢ÏñÕâÑùд³ö for Ñ­»·£º

for n in 1 2 3doecho $ndone

µÇ¼ºó¸´ÖÆ

ÎÒϲ»¶½« do ºÍ for ·ÅÔÚͳһÐÐ £¬ÕâÑùÎÒ¸üÈÝÒ×ÔĶÁ£º

for n in 1 2 3 ; doecho $ndone

µÇ¼ºó¸´ÖÆ

Ò»´Î¶à¸ö for Ñ­»·

Äã¿ÉÒÔ½«Ò»¸öÑ­»··ÅÔÚÁíÒ»¸öÑ­»·ÖС£Õâ¿ÉÒÔ×ÊÖúÄãµü´ú¶à¸ö±äÁ¿ £¬Ò»´Î×ö²»Ö¹Ò»¼þÊ¡£¼ÙÉèÄãÏë´òÓ¡³ö×Öĸ A¡¢B ºÍ C ÓëÊý×Ö 1¡¢2 ºÍ 3 µÄËùÓÐ×éºÏ¡£Äã¿ÉÒÔÔÚ Bash ÖÐʹÓÃÁ½¸ö for Ñ­»·À´ÊµÏÖ £¬ÈçÏÂËùʾ£º

#!/bin/bashfor number in 1 2 3 ; dofor letter in A B C ; doecho $letter$numberdonedone

µÇ¼ºó¸´ÖÆ

ÈôÊǽ«ÕâЩÐзÅÔÚÃûΪ for.bash µÄ Bash ¾ç±¾ÎļþÖв¢ÔËÐÐËü £¬Äã»á¿´µ½¾ÅÐÐÏÔʾÁËËùÓÐ×ÖĸÓëÿ¸öÊý×ÖÅä¶ÔµÄ×éºÏ£º

$ bash for.bashA1B1C1A2B2C2A3B3C3

µÇ¼ºó¸´ÖÆ

±éÀú Web Çå¾²ÑÕÉ«

Web Çå¾²ÑÕÉ«ÊÇ´ÓÊ®Áù½øÖÆÑÕÉ« #000£¨ÐþÉ« £¬¼´ºìÉ«¡¢ÂÌÉ«ºÍÀ¶É«Öµ¾ùΪÁ㣩µ½ #fff£¨°×É« £¬¼´ºìÉ«¡¢ÂÌÉ«ºÍÀ¶É«¾ùΪ×î¸ß£© £¬Ã¿¸öÊ®Áù½øÖÆÖµµÄ²½½øΪ 0¡¢3¡¢6¡¢9¡¢c ºÍ f¡£

Äã¿ÉÒÔÔÚ Bash ÖÐʹÓÃÈý¸ö for Ñ­»·ÌìÉú Web Çå¾²ÑÕÉ«µÄËùÓÐ×éºÏµÄÁбí £¬ÆäÖÐÑ­»·±éÀúºìÉ«¡¢ÂÌÉ«ºÍÀ¶É«Öµ¡£

#!/bin/bashfor r in 0 3 6 9 c f ; dofor g in 0 3 6 9 c f ; dofor b in 0 3 6 9 c f ; doecho "#$r$g$b"donedonedone

µÇ¼ºó¸´ÖÆ

ÈôÊǽ«ÆäÉúÑÄÔÚÃûΪ websafe.bash µÄРBash ¾ç±¾Öв¢ÔËÐÐËü £¬Äã¾Í»á¿´µ½ËùÓÐ Web Çå¾²ÑÕÉ«µÄÊ®Áù½øÖÆÖµµÄµü´ú£º

$ bash websafe.bash | head#000#003#006#009#00c#00f#030#033#036#039

µÇ¼ºó¸´ÖÆ

ÒªÖÆ×÷¿ÉÓÃ×÷ Web Çå¾²ÑÕÉ«²Î¿¼µÄ HTML Ò³Ãæ £¬ÄãÐèҪʹÿ¸öÌõÄ¿³ÉΪһ¸öµ¥¶ÀµÄ HTML ÔªËØ¡£½«Ã¿ÖÖÑÕÉ«·ÅÔÚÒ»¸ö 

 ÔªËØÖÐ £¬²¢½«Åä¾°ÉèÖÃΪ Web Çå¾²ÑÕÉ«¡£ÎªÁËʹʮÁù½øÖÆÖµ¸üÒ×ÓÚÔĶÁ £¬½«Æä·ÅÔÚµ¥¶ÀµÄ 
 ÔªËØÖС£½« Bash ¾ç±¾¸üÐÂΪÈçÏ£º<div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:php;toolbar:false">#!/bin/bashfor r in 0 3 6 9 c f ; dofor g in 0 3 6 9 c f ; dofor b in 0 3 6 9 c f ; doecho &quot;&lt;div style=&quot;background-color:#$r$g$b&quot;&gt;&lt;code&gt;#$r$g$b&lt;/code&gt;&lt;/div&gt;&quot;donedonedone</pre><div class="contentsignin">µÇ¼ºó¸´ÖÆ</div></div> <p>µ±ÄãÔËÐÐÐ嵀 Bash ¾ç±¾²¢½«Ð§¹ûÉúÑĵ½ HTML Îļþʱ £¬Äã¿ÉÒÔÔÚä¯ÀÀÆ÷ÖÐÉó²éËùÓÐ Web Çå¾²ÑÕÉ«µÄÊä³ö£º</p> <div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:php;toolbar:false">$ bash websafe.bash &amp;gt; websafe.html</pre><div class="contentsignin">µÇ¼ºó¸´ÖÆ</div></div> <p style="text-align:center;"><img src="https://img.php.cn/upload/article/000/887/227/168872725169624.jpg" alt="ʹÓà Bash ÖÆ×÷ Web Çå¾²ÑÕÉ«"></p> <p><em>Colour gradient.</em></p> <p>Õâ¸öÍøÒ³²»ÊǺÜÔÃÄ¿¡£ÉîÉ«Åä¾°ÉϵÄÐþÉ«ÎÄ×ÖÎÞ·¨ÔĶÁ¡£ÎÒϲ»¶Ê¹ÓÃHTMLÑùʽ £¬ÒÔÈ·±£ÔÚÑÕÉ«¾ØÐÎÉÏÒÔ°×É«Îı¾ÏÔʾʮÁù½øÖÆÖµ £¬²¢ÇÒÅ侰ΪÐþÉ«¡£ÎÒʹÓÃÁËHTMLÍø¸ñÑùʽ½«Ã¿ÐÐÁù¸ö¿ò¾ÙÐÐÅÅÁÐ £¬²¢ÎªÁËÑŹÛЧ¹û £¬ÔÚ¿òÖ®¼äÁôÓÐÊʵ±µÄ¼ä¾à¡£</p> <p>ÄãÐèÒªÔÚÑ­»·Ö®Ç°ºÍÖ®ºó°üÀ¨ÆäËûµÄHTMLÔªÏòÀ´Ìí¼ÓÌØÁíÍâÑùʽ¡£ÔÚ¶¥²¿µÄHTML´úÂëÖнç˵Ñùʽ £¬²¢Ôڵײ¿µÄHTML´úÂëÖйرÕËùÓÐÒÑ·­¿ªµÄHTML±êÇ©</p> <div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:php;toolbar:false">#!/bin/bashcat&lt;title&gt;Web-safe colors&lt;/title&gt;&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;&lt;style&gt;div {padding-bottom: 1em;}code {background-color: black;color: white;}@media only screen and (min-width:600px) {body {display: grid;grid-template-columns: repeat(6,1fr);column-gap: 1em;row-gap: 1em;}div {padding-bottom: 3em;}}&lt;/style&gt;EOFfor r in 0 3 6 9 c f ; dofor g in 0 3 6 9 c f ; dofor b in 0 3 6 9 c f ; doecho &quot;&lt;divstyle&gt;&lt;code&gt;#$r$g$b&lt;/code&gt;&lt;/divstyle&gt;</pre><div class="contentsignin">µÇ¼ºó¸´ÖÆ</div></div> “donedonedonecat

ÒÔÉϾÍÊÇʹÓà Bash ÖÆ×÷ Web Çå¾²ÑÕÉ«µÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí £¬°æȨÕùÒéÓë±¾Õ¾ÎÞ¹Ø £¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í×ðÁú¿­Ê±ÂËÓÍ»úÍø¹Ù·½Ì¬¶È £¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ £¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢ £¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢ £¬ÇëÄúÁ¬Ã¦ÁªÏµ×ðÁú¿­Ê±ÊµÊ±ÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎå £¬9:30-18:30 £¬½ÚãåÈÕÐÝÏ¢

QR code
¡¾ÍøÕ¾µØͼ¡¿¡¾sitemap¡¿