ʹÓÃEclipse¾ÙÐÐLinux Shell¾ç±¾¿ª·¢µÄ»ù±¾ÉèÖÃÖ¸ÄÏ
ʹÓÃeclipse¾ÙÐÐlinux shell¾ç±¾¿ª·¢µÄ»ù±¾ÉèÖÃÖ¸ÄÏ
ÔÚLinuxÇéÐÎÏ£¬Shell¾ç±¾ÊÇÒ»ÖÖÇ¿Ê¢ÇÒ³£Óõıà³ÌÓïÑÔ£¬ÓÃÓÚ×Ô¶¯»¯Ö´ÐÐÖÖÖÖʹÃüºÍÖÎÀíϵͳ¡£EclipseÊÇÒ»¿î¹¦Ð§Ç¿Ê¢µÄ¼¯³É¿ª·¢ÇéÐΣ¨IDE£©£¬¿ÉÒÔ×ÊÖú¿ª·¢Ö°Ô±¸ü¸ßЧµØ±àд¡¢µ÷ÊÔºÍÖÎÀíShell¾ç±¾¡£±¾ÎĽ«ÏÈÈÝÔõÑùÔÚEclipseÖÐÉèÖúÍʹÓÃShell¾ç±¾¿ª·¢ÇéÐΡ£
µÚÒ»²½£º×°ÖÃEclipseºÍShell¾ç±¾²å¼þ
Ê×ÏÈ£¬»á¼ûEclipse¹Ù·½ÍøÕ¾£¨https://www.eclipse.org/£©ÏÂÔØ×îеÄEclipse IDE for JEE Developers°æ±¾¡£
Íê³ÉÏÂÔغ󣬽âѹѹËõÎļþµ½ÄãÏëҪװÖõÄĿ¼Ï¡£È»ºó½øÈëEclipseĿ¼£¬ÕÒµ½eclipse¿ÉÖ´ÐÐÎļþ£¬Ë«»÷ÔËÐС£
ÔËÐÐEclipseºó£¬µã»÷¡°Help¡±²Ëµ¥£¬Ñ¡Ôñ¡°Eclipse Marketplace¡±¡£
ÔÚµ¯³öµÄ¶Ô»°¿òÖУ¬ËÑË÷²¢×°Öá°ShellEd¡±²å¼þ¡£ShellEdÊÇÒ»¿îÇ¿Ê¢µÄShell¾ç±¾Óï·¨¸ßÁÁºÍ×Ô¶¯Íê³É²å¼þ£¬¿ÉÒÔÌáÉý¿ª·¢Ð§ÂÊ¡£
×°ÖÃÍê±Ïºó£¬ÖØÐÂÆô¶¯Eclipse¾Í¿ÉÒÔ×îÏÈÉèÖÃShell¾ç±¾¿ª·¢ÇéÐÎÁË¡£
µÚ¶þ²½£º½¨ÉèShell¾ç±¾ÏîÄ¿
ÔÚEclipseÖУ¬Í¨¹ý½¨Éè¡°Shell Script Project¡±À´×îÏÈÒ»¸öеÄShell¾ç±¾ÏîÄ¿¡£
µã»÷¡°File¡±²Ëµ¥£¬Ñ¡Ôñ¡°New¡± -> ¡°Project¡±£¬ÔÚµ¯³öµÄ¶Ô»°¿òÖÐÑ¡Ôñ¡°Shell Script¡± -> ¡°Shell Script Project¡±£¬È»ºóµã»÷¡°Next¡±¡£
ÔÚÏîÄ¿ÉèÖÃÖУ¬ÊäÈëÏîÄ¿Ãû³ÆºÍÉúÑÄλÖ㬵ã»÷¡°Finish¡±Íê³ÉÏîÄ¿½¨Éè¡£
µÚÈý²½£ºÉèÖÃShell¾ç±¾±àÒëÆ÷
ÔÚEclipseÖУ¬ÐèÒªÉèÖÃShell¾ç±¾±àÒëÆ÷ÒÔ°ü¹ÜÓï·¨¼ì²éºÍ×Ô¶¯Íê³ÉµÄ׼ȷÐÔ¡£
µã»÷¡°Window¡±²Ëµ¥£¬Ñ¡Ôñ¡°Preferences¡±£¬ÔÚµ¯³öµÄ¶Ô»°¿òÖÐÑ¡Ôñ¡°Shell Script¡± -> ¡°Interpreter¡±£¬È»ºóµã»÷¡°Add¡±Ìí¼ÓShell¾ç±¾±àÒëÆ÷¡£
ÔÚµ¯³öµÄ¶Ô»°¿òÖУ¬Ñ¡Ôñ¡°ShellEd¡±²å¼þÌṩµÄ¾ç±¾±àÒëÆ÷£¬ÊäÈë·¾¶ºÍÃû³Æ£¬È»ºóµã»÷¡°OK¡±¡£
ÉèÖÃÍê³Éºó£¬µã»÷¡°OK¡±ÉúÑÄÉèÖá£
µÚËIJ½£º±àдºÍÔËÐÐShell¾ç±¾
ÔÚEclipseÖУ¬¿ÉÒÔÖ±½Ó½¨ÉèºÍ±à¼Shell¾ç±¾Îļþ¡£
ÓÒ¼üµ¥»÷Shell¾ç±¾ÏîÄ¿£¬ÔÚµ¯³öµÄ²Ëµ¥ÖÐÑ¡Ôñ¡°New¡± -> ¡°File¡±£¬ÊäÈëÎļþÃû³ÆºÍÀ©Õ¹Ãû£¨ÀýÈ磺test.sh£©£¬È»ºóµã»÷¡°Finish¡±½¨Éè¾ç±¾Îļþ¡£
Ñ¡Ôñ¸Õ½¨ÉèµÄShell¾ç±¾Îļþ£¬²¢ÔÚ±à¼Æ÷ÖÐÊäÈëÒÔÏÂʾÀý´úÂ룺
#!/bin/bash echo "Hello, World!"
µÇ¼ºó¸´ÖÆ
ÉúÑÄÎļþºó£¬¿ÉÒÔÓÒ¼üµ¥»÷Shell¾ç±¾Îļþ£¬Ñ¡Ôñ¡°Run As¡± -> ¡°Shell Script¡±À´ÔËÐо籾¡£
ÔÚConsoleÊä³öÖУ¬Ä㽫¿´µ½¡°Hello, World!¡±µÄÊä³öЧ¹û¡£
µÚÎå²½£ºµ÷ÊÔShell¾ç±¾
ÔÚEclipseÖУ¬¿ÉÒÔͨ¹ýµ÷ÊÔ¹¦Ð§À´²éÕÒÏ¢Õù¾öShell¾ç±¾ÖеĹýʧ¡£
ÔÚ±à¼Æ÷ÖУ¬ÓÒ¼üµ¥»÷ÐèÒªµ÷ÊÔµÄShell¾ç±¾Îļþ£¬Ñ¡Ôñ¡°Debug As¡± -> ¡°Shell Script¡±£¬»òÕßµã»÷Debugͼ±ê¡£
ÔÚµ÷ÊÔÊÓͼÖУ¬Äã¿ÉÒÔÉèÖöϵ㡢Öð²½Ö´ÐдúÂë¡¢ÊÓ²ì±äÁ¿ÖµµÈ¡£
µ÷ÊÔÀú³ÌÖУ¬Äã¿ÉÒÔͨ¹ý¿ØÖÆ̨Êä³öºÍ±äÁ¿ÊӲ촰¿ÚÀ´Éó²éÖ´ÐÐЧ¹ûºÍ±äÁ¿Öµ¡£
×ܽ᣺
ͨ¹ýÒÔÉÏ°ì·¨£¬ÄãÒѾÀÖ³ÉÉèÖÃÁËEclipseµÄShell¾ç±¾¿ª·¢ÇéÐΣ¬²¢Ñ§»áÁ˽¨Éè¡¢±à¼¡¢ÔËÐк͵÷ÊÔShell¾ç±¾¡£Ê¹ÓÃEclipseµÄÇ¿Ê¢¹¤¾ßºÍ²å¼þ£¬Äã¿ÉÒÔ¸ü¸ßЧµØ¿ª·¢¡¢²âÊԺͰ²ÅÅShell¾ç±¾£¬Ìá¸ßÊÂÇéЧÂÊ¡£
Ï£Íû±¾ÎĶÔÄãÔÚLinuxϵͳÖоÙÐÐShell¾ç±¾¿ª·¢ÌṩÁËһЩ×ÊÖú¡£Ô¸ÄãÔÚ¿ª·¢Àú³ÌÖÐÏíÊܱà³ÌµÄÐËȤ£¡
ÒÔÉϾÍÊÇʹÓÃEclipse¾ÙÐÐLinux Shell¾ç±¾¿ª·¢µÄ»ù±¾ÉèÖÃÖ¸ÄϵÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡