shell script ãæ¸ãã¨ãã® tips 2ã¤(åå¿è åã) 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 æã®ä¸é¨ã§ããã &
/etc/profileã¨ã~/.bash_profileã¨ã~/.bash_loginã¨ã~/.profileã¨ã~/.bashrcã¨ãå¤ããã¦ããããã¼ãã½(`д)ï¾ ã¨ããããã§ã調ã¹ã¦ã¿ãã ãã£ã¹ããªãã¥ã¼ã·ã§ã³ã«ãã£ã¦è¥å¹²ç°ãªã£ãããããããããªãã ãã°ã¤ã³æ /etc/profile â (/etc/bash.bashrc) â»Debianç³» â ~/.bash_profile ï¼ãªãå ´åï¼â â ~/.bash_login ï¼ãªãå ´åï¼â â ~/.profile â â ~/.bashrc ââââââââââââââââââ â (/etc/bashrc) â»RedHatç³» ã¾ã/etc/profileãèªã¿è¾¼ã¾ããã ã¾ããæè¿ã®ãã£ã¹ããªãã¥ã¼ã·ã§ã³ã ã¨/etc/profileã®ä¸ã§/etc/profile.dã®ä¸èº«ãèªã¿è¾¼ããããªè¨å®ãããã¦ããããããã D
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}