Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article?
ããã«ã¡ã¯ã7æã«ãªãã¾ããããæ¬æ¥7æ2æ¥ã¯ããã«ã¹ã¯ã©ãããã1æ¥ã§CMSãä½ã ã·ã§ã«ã¹ã¯ãªããé«ééçºææ³å ¥éãçºå£²æ¥ã§ãããã¾ããKADOKAWA/ã¢ã¹ãã¼ã»ã¡ãã£ã¢ã¯ã¼ã¯ã¹æ§ããç®æ¬ããã ãã¾ãã¦æé£ããããã¾ãã [amazonjs asin="4048660683" locale="JP" title="ãã«ã¹ã¯ã©ãããã1æ¥ã§CMSãä½ã ã·ã§ã«ã¹ã¯ãªããé«ééçºææ³å ¥é"] ç®æ¬¡ã ããèªãã¨ãbashã§CMSãä½ãã®ã«ç¹åãã解説æ¬ã®ããã«è¦ãã¾ãããCMSã®ã³ã¼ãã¯å ¨ä½ã®3å²ããªããå®éã«ã¯awkãsedã®æååå¦çãbashã®é¢æ°ã®ä½¿ãæ¹ãªã©ãã·ã§ã«è¸åå¼·ä¼ ä¼å ´ã§ãã§ããï¼ãã®åä¹ããä¸ããã®ã«é常ã«å½¹ç«ã¤TIPSã®éåä½ã¨ãè¨ãã¾ãããã å¿è«æ¬æ¸ã®ç®çã¯ã·ã§ã«è¸åå¼·ä¼å¯¾çæ¬ã§ã¯ãªãã®ã§ãããbashCMSãä½ããã¨ããé¡æãéãã¦ãUNIXã®ãä½æ³ã ãã§ããã
ã¨ããã³ãã³ã㧠bash ã®è£å®æ¸ããããªãã¨æã£ã¦ããããã㨠bashrc çãªã®æ¸ãã¦~/.bashrcã¨ãã§source使ã£ã¦èªã¿è¾¼ã¾ãããã¨ã«ãªãã¨æãã¾ãã ãã§ãã³ãã³ã㨠bashrc ãã»ããã¿ãããªæããªã®ã§ã以ä¸ã®æ§ãªæãã®ãã£ã¬ã¯ããªæ§æã§é©å½ã«é ç½®ãã¦ãsourceã§èªã¿è¾¼ã¾ãããã¤ãã§ã« PATH ãéãã¦ãããã¨ãããããªã¨æã£ãããã§ãã /path/to/ `-- kamipo |-- bin | `-- make_kanojo `-- etc `-- bashrc $ source /path/to/kamipo/etc/bashrc $ which make_kanojo /path/to/kamipo/bin/make_kanojo sourceã«æ¸¡ãå¼æ°ã¯çµ¶å¯¾ãã¹ã ãã§ãããã§ãããæã§å®è¡ããã¨ãã¨ãç¸å¯¾ãã¹ã¨ãããã¡ã¤ã«åã ãã¨ãããããæã
ããããæ¹æ³ãããã¨ãããã®ã§ããã以ä¸ã®ãããªã·ã§ã«ã¹ã¯ãªããã§ãã¾ããã®ã¯ã©ãã§ãããã? #!/bin/bash function kill_children { # jobs -l | perl -ne 'print "kill $1\n" if /^\S+?\s+(\d+)/' | sh; pkill -P $$; wait; } trap "kill_children" EXIT HOSTS="192.168.1.1 192.168.1.2" for host in $HOSTS do ssh $host tail -F /service/foo/log/main/current & done wait ã¡ãã£ã¨ç®æ¡æ¸ãã§è§£èª¬ããã¨ä»¥ä¸ã®ãããªãã¨ããããªã£ã¦ãã¾ãã & ã§ããã¯ã°ã©ã¦ã³ãã¸ã§ããã¯ããããwait ã§ãããã®çµäºãå¾ ã¤trap ã EXIT 㯠atexit
shell script ã¯æ®æ®µããã¦éãããã¨é¡ã£ã¦ãã¾ãªãããã§ããããã¾ã«ã¯æ¸ããªãã¨ãããªããã¨ãããã®ã§ãããããã¨ãã¯è¦ãã¦ããã¨ä¾¿å©ãª tips ã2ã¤ã autodie ã£ã½ãããset -eã¨ããã¨ãã³ãã³ãã®å®è¡ã«å¤±æããã¨ãã«ããã§å®è¡ãã¨ã¾ãã®ã§ä¾¿å©ã #!/bin/sh set -e perl -e 'die' echo SHOULD NOT REACH HEREã¨ãã㨠% ./hoge.sh Died at -e line 1. % echo $? 255ã¨ãªã£ã¦ãæå¾ã¾ã§ãããã«æ»ã«ã¾ãã è¤æ°ã®ã³ãã³ããé çªã«å®è¡ããã¨ãã«ä¾¿å©ã ãªãã以ä¸ã®ãããªæåããããã ããã§ãã ãã ã失æããã³ãã³ãã until ã¾ã㯠while ã«ã¼ãã®ä¸é¨ã§ããã if æã®ä¸é¨ã§ããã && ã¾ã㯠|| ãªã¹ãã®ä¸é¨ã§ããã ã³ãã³ãã®è¿ãå¤ã ! ã§å転ããã¦ã
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}