$ wget --random-wait -r -p -e robots=off -U mozilla http://www.example.com
$ wget --random-wait -r -p -e robots=off -U mozilla http://www.example.com
@hirose31 ããããã·ã§ã«ã¹ã¯ãªããã§ããã£ã件âãåãã¹ãããªåé¿æ¹æ³ãã§ãé¡ãåºããã¦ãã¦ãããã«åçãã¦ã¿ã¾ããã ãã®å 容ã¯ãªã³ã¯å ãè¦ã¦ãããã¨ãã¦ãåçã®ä¸ã§ä½¿ã£ãbashã®ããã»ã¹ç½®æã«ã¤ãã¦æ¸ãããè¨äºããã¾ãè¦ãªãã®ã§ãåçã§ä½¿ã£ãããã»ã¹ç½®æã®ãã¨ãã¨ã³ããªã«ãã¦ã¿ããã¨æãã¾ãã æåã«æ³¨æç¹ã§ãããããã»ã¹ç½®æã®æ©è½ã¯ãbashãzsh*1ã®æ©è½ã§POSIXäºæã®æ©è½ã§ã¯ããã¾ããããã®ããã使ç¨æã«ã¯ã対å¿ãã¦ããªãã·ã§ã«ã§ã¯ä½¿ãã¾ããããbashã§ä½¿ãå ´åã /bin/sh ã§ã¯ãªã /bin/bash ãæ示çã«æå®ããå¿ è¦ãããã¾ãããã¨ãã°ãããã»ã¹ç½®æã使ã£ãã¹ã¯ãªãããscript.shãã«å¯¾ãã¦"$ bash script.sh" ã¨ããã³ãã³ãã¯æåãã¾ããã"$ sh script.sh" ã¨ããã³ãã³ãã¯å¤±æãã¾ãããã®è¾ºãã®éãã¯ã/
http://tldp.org/LDP/abs/html/process-sub.html ã³ãã³ãã®å®è¡çµæãååä»ããã¤ãã§èªãããããã Command list enclosed within parentheses >(command_list) <(command_list) Process substitution uses /dev/fd/ files to send the results of the process(es) within parentheses to another process. man bash ã«ãæ¸ãã¦ãã£ãã æ¢ãæ±ãã¦ãæ©è½ã®1ã¤ã ãããç¥ããªãã£ãããä»ã¾ã§ã¯ã $ ./hoge > hoge.out $ ./fuga > fuga.out $ diff -u hoge.out fuga.outãããªé¢¨ã«tmpãã¡ã¤ã«ä½æãã¦diffã£
# æ¨æºå ¥åãæå®ã®å¤æ°åã«1è¡1å¤ã®é åã¨ãã¦èªã¿è¾¼ãé¢æ° read2arr() { [[ $1 =~ ^[a-zA-Z][a-zA-Z0-9_]*$ ]] || return 1 local IFS= eval "local $1_" eval "$1=()" eval "while read -r $1_ || [[ -n \$$1_ ]]; do $1+=(\"\$$1_\"); done" } $ # é¢æ°ãèªã¿è¾¼ãã§ãã $ . read2arr.sh $ # ãã¹ãç¨ãã¡ã¤ã«ãä½ã(空è¡ã¨ãè¡é è¡æ«ã®ç©ºç½ã¨ãã¿ãæåãã¯ãªã¼ãå ¥ãã¨ãæçµæ¹è¡ç¡ãã¨ãå«ãªæãã®ãã¼ã¿ãä½ã) $ echo foo > /tmp/file1 $ echo >> /tmp/file1 $ echo $'\ta b ' >> /tmp/file1 $ echo 'a\tb\\n' >> /tmp/f
ã·ã§ã«ã¹ã¯ãªããã®ä¸ã§ãã¹ãã¼ã¹åºåããããã¯ã¿ãåºåãã®ã¬ã³ã¼ããæ±ããã¨ãããããã¨æãã¾ãã ãã¨ãã°ãååã®ã¨ã³ããªãAWS CLIã¨jqã使ã£ã¦ãAWSã®ELBããªã¥ã¼ã ãã¢ã¿ããããã¦ããEC2ã¤ã³ã¹ã¿ã³ã¹åãåºåããã¯ã³ã©ã¤ãã¼ãæ¸ãã - åå å·¥å ´æ¥èªãã®ã¹ã¯ãªããã®åºåã¯ä»¥ä¸ã®ããã«ãªãã¾ãã i-ec56a9f5 vol-07d00601 servername i-ec56a9f5 vol-8f550991 servername ãã®ãããªã¬ã³ã¼ãã®ç¹å®ã®åãåãåºãã¦ãå¦çããéã«ã©ãããã®ãå¹ççããã¨ããã®ããã®ã¨ã³ããªã®ãé¡ã§ãã é常ã«å¤ã話é¡ãªã®ã§ãæããã·ã§ã«ã¹ã¯ãªãããæ¸ãã¦ãã人ã«ã¯èªæãªè©±ã§ã¯ããã¾ãããæè¿ãã·ã§ã«ã®æ¨æºæ©è½ã®è©±ãèãæ©ä¼ããªãã失ããã¤ã¤ããæè¡ã«ãªã£ã¦ãã¦ããæ°ããã¦ããã®ã§ãæ¹ãã¦ç¢ºèªã¨ãããã¨ã§ã ä¾ã¨ãã¦æããã¬ã³ã¼ããã
ã¯ããã« bashã·ã§ã«ã¹ã¯ãªããã®è¨è¿°ã®ä»æ¹ã«é¢ããã¡ã¢æ¸ãã§ãã ãã¡ã¤ã«å ¥åºåããã¤ãã©ã¤ã³å¦çãä¸å¿ã« ã·ã§ã«ãå¾æãªã®ã¯ãã¡ã¤ã«å ¥åºåããã¤ãã©ã¤ã³å¦çãªã®ã§ãè¤éãªæ§æã¯ã§ããã ã使ããããããã®ä½¿ç¨ãä¸å¿ã¨ããã³ã¼ããæ¸ãã¾ãã PATH ã³ãã³ããã¨ã«ãã«ãã¹ãå¤æ°ã«æ ¼ç´ãããªã©ã¯æéãªã®ã§ãå¿ è¦ãªç°å¢å¤æ°$PATHãexportãã¦ããã¾ãã ããã§ãå¿ è¦ãªå ´åã¯ãã«ãã¹ãå¤æ°ã«æ ¼ç´ãã¦ããã¾ãã æ¨æºåºåãæ¨æºã¨ã©ã¼åºåã®ãªãã¤ã¬ã¯ã æ¨æºåºå(1)ãæ¨æºã¨ã©ã¼åºå(2)ã¯ããã©ã«ãã¯ç»é¢ã«ãªã£ã¦ãã¾ãã ãã以å¤ã«ã¨ã©ã¼ã¡ãã»ã¼ã¸ãå®ç¾©ããå ´åãæ¨æºã¨ã©ã¼åºå(2)ã«ãªãã¤ã¬ã¯ããã¾ãã
ããæè¿ã沢山ã·ã§ã«ã¹ã¯ãªãããæ¸ãããã«ãªãã¾ããã å ã ãã¾ãã·ã§ã«ã¹ã¯ãªãããæ¸ãããã¨ç¡ãã£ãã®ã§ãè²ã ã¨åå¼·ãã¤ã¤æ¸ãã¦ãã®ã§ããã ä»ã®ããã°ã©ãã³ã°è¨èªã¨ã¯ã¡ãã£ã¨éã£ã¦ç¬ç¹ãªã¯ã»ã¨ããããçºè¦ã®åº¦ã«ããã¼ï¼ã£ã¦ãªããã¨ã沢山ãã£ã¦æ¥½ããã§ãã ãããªããã§ãæè¿å¦ãã ãåèã«ããä¸ã§ç¹ã«æåããã·ã§ã«ã®ä¸æãæ¸ãæ¹ãã¾ã¨ãã¦ã¿ã¾ãã ãã£ã¨ã¾ã ç¥ããªããã¨ã¨ããã£ã¨ä¸æãããæ¹æ³ãªããã沢山è¦ã¤ãããããªã®ã§ã ãã£ã¨ããããæ¹ãããï¼ã£ã¦æ¹ã¯ã³ã¡ã³ããã ãã ä½ãããªã : (ã³ãã³)ã³ãã³ã ã·ã§ã«ãæ¸ãã¦ããæã«é常ã«æ¬²ããã£ãã³ãã³ããããï¼ä½ãããªãï¼ : ã¨ããã³ãã³ã(ï¼)ãå©ç¨ããã¨ã**ä½ãããã«çµäºã¹ãã¼ã¿ã¹0(ã¤ã¾ãæ£å¸¸çµäº)**ãè¿ãã¾ãã ãããæ§ã ãªäºã«ä½¿ããä¸è½ã³ãã³ãã§ãããã«ãã£ã¦é¢åãªã¨ã©ã¼å¦çãç°¡æ½ã«ã§ãããã å ¥åãåºåã®ãªãã¤ã¬ã¯ã
å°ãåã«ãªã©ã¤ãªã¼ã®å ¥éBashãèªãã§ããã®ãããã°æ¹æ³ãç¥ã£ã¦ãããã¼ãã¨æåãããã®ã§ããã®åã³ãæ¸ãã¦ã¿ã¾ããã shç³»ã«ã¯ trap ã¨ããã³ãã³ãã§ã·ã°ãã«ãã©ãããã§ãã¦ä¾¿å©ã§ãããbash ã«ã¯ããã«ä¾¿å©ãªçä¼¼ã·ã°ãã«ã¨ãããã®ããã£ãããã¾ããbashã®manpagerãã¿ãã¨ãtrapã®sigspecãERRã¨ããå ´åãã³ãã³ãã0以å¤ã§exitããå ´åã«ãã©ãããã¦ãããããã§ãã If a sigspec is ERR, the command arg is executed whenever a simple command has a non-zero exit status, subject to the following conditions. The ERR trap is not executed if the failed command is pa
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}