ºìÁªLinuxÃÅ»§
Linux°ïÖú

¹ØÓÚshell½Å±¾

·¢²¼Ê±¼ä:2008-04-05 15:47:50À´Ô´:ºìÁª×÷Õß:Htgiot
ÔÚlinuxÖУ¬Èç¹ûÔÚshell½Å±¾µÚÒ»ÐмÓÉÏ

#!/bin/bash

ÕâÑùÒ»ÐУ¬ÄÇô£¬ÎÞÂÛÔÚÄĸöshellÖÐÔËÐÐÕâ¸ö½Å±¾£¬ÏµÍ³¶¼»áµ÷ÓÃÄãÔÚÕâÒ»ÐÐÖ¸¶¨µÄshellÀ´½âÊÍÕâ¸ö½Å±¾¡£

±ÈÈç#!/bin/bash¾ÍÖ¸¶¨Á˸ýű¾ÓÉ /bin/bash À´½âÊÍ£¬¶ø#!/bin/cshÔòÖ¸¶¨¸Ã½Å±¾ÓÉ/bin/cshÀ´½âÊÍ¡£

Èç¹ûûÓÐÕâµÚÒ»ÐУ¬Ö±½ÓÔÚshellÖÐÔËÐÐÕâ¸ö½Å±¾£¬ÄÇô£¬¸Ã½Å±¾¾ÍÓɵ±Ç°µÄshell½âÊÍ¡£

È»¶ø£¬Èç¹ûûÓÐÖ¸¶¨ÕâµÚÒ»ÐУ¬²¢Ê¹ÓÃnohup myScript ºǫ́ÔËÐÐÕâ¸ö½Å±¾µÄ»°£¬nohup»á×Ô¶¯µ÷ÓÃ/bin/shÀ´½âÊÍÕâ¸ö½Å±¾¡£Ò»°ãÀ´Ëµ£¬/bin/shÊÇÒ»¸ö·ûºÅÁ´½Ó£¬ËüÖ¸Ïò»úÆ÷ÉÏÒѾ­°²×°µÄij¸öshell£¬¿ÉÄÜÊÇ/bin/bash£¬Ò²¿ÉÄÜÊÇ/bin/sh,/bin/dashµÈ¸÷¸öshellÖÐÈκÎÒ»¸ö¡£

ls /bin/sh -l ¿ÉÒԲ鿴¸ÃÁ´½ÓÖ¸ÏòÄÄÒ»¸ö¡£

ÔÚдshell½Å±¾µÄʱºò£¬×îºÃÑø³ÉÔÚµÚÒ»ÐÐÖ¸¶¨shellµÄÏ°¹ß¡£ÒòΪ£¬²»Í¬µÄshell£¬ÔÚÓÐЩÃüÁîÉÏÊDz»Ò»ÑùµÄ¡£ÔÚÒ»¸öshellÖÐÔËÐÐÕýÈ·µÄ½Å±¾£¬ÔÚÁíÒ»¸öshellÖпÉÄܲ»ÄÜÕýÈ·ÔËÐС£
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 1 ÌõÆÀÂÛ

  1. zzu_gis ÓÚ 2008-04-05 20:52:11·¢±í:

    #ºóµÄ¶«Î÷²»ÊDz»¿ÉÒÔÖ´ÐÐÂð£¿Ö»ÊÇ×¢ÊÍÂð£¿ÎªÊ²Ã´»áÓÐÒâÒ壿