LinuxÏÂÊÇ·ñÄÜÔËÐÐ.sh¾ç±¾Îļþ£¿
ÔÚLinuxϵͳÏ£¬¿ÉÒÔͨ¹ýbashÀ´ÔËÐÐ.sh¾ç±¾Îļþ¡£ÏÂÃæÊÇÏêϸµÄ´úÂëʾÀý£º
Ê×ÏÈ£¬·¿ªÖնˣ¬½øÈëµ½´æ·Å.sh¾ç±¾ÎļþµÄĿ¼¡£¼ÙÉèÎÒÃÇÓÐÒ»¸öÃûΪexample.shµÄ¾ç±¾Îļþ£¬ÄÚÈÝÈçÏ£º
#!/bin/bash echo "Hello, World!"
µÇ¼ºó¸´ÖÆ
½Ó×Å£¬ÔÚÖÕ¶ËÖÐÖ´ÐÐÒÔÏÂÏÂÁîÀ´ÔËÐÐÕâ¸ö¾ç±¾Îļþ£º
bash example.sh
µÇ¼ºó¸´ÖÆ
»òÕß¿ÉÒÔ¸ø¾ç±¾ÎļþÌí¼ÓÖ´ÐÐȨÏÞ£¬È»ºóÖ±½ÓÖ´ÐУº
chmod +x example.sh ./example.sh
µÇ¼ºó¸´ÖÆ
ÒÔÉϾÍÊÇÔÚLinuxϵͳÏÂÔËÐÐ.sh¾ç±¾ÎļþµÄ¼òÆÓʾÀý¡£¿ÉÒÔƾ֤ÏÖÕæÏàÐÎÐ޸ľ籾ÄÚÈݺÍÖ´Ðз½·¨¡£LinuxϵͳµÄÎÞаÐÔºÍÇ¿Ê¢¹¦Ð§Ê¹µÃ.sh¾ç±¾ÎļþÔÚÆäÖÐÔËÐбäµÃºÜÊÇÀû±ã¡£
ÒÔÉϾÍÊÇLinuxÏÂÊÇ·ñÄÜÔËÐÐ.sh¾ç±¾Îļþ£¿µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡
ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí£¬°æȨÕùÒéÓë±¾Õ¾Î޹أ¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í×ðÁú¿Ê±ÂËÓÍ»úÍø¹Ù·½Ì¬¶È£¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ£¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢£¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢£¬ÇëÄúÁ¬Ã¦ÁªÏµ×ðÁú¿Ê±ÊµÊ±ÐÞÕý»òɾ³ý¡£