bashã¤ãã£ãªã ãã¯ã³ã©ã¤ãã¼ã«ã¼ãã¨è¨å®ãã¡ã¤ã«èªã¿è¾¼ã¿
bashã¯ã³ã©ã¤ãã¼ã«ã¼ããããã
ã¯ã³ã©ã¤ãã¼ã§ã«ã¼ããæ¸ãã¦ãããã»ã¹ãç£è¦ããã¨ãããããã®ããããããã¨æ¸ããã¨è²ã ã¨æã
ããç¯å²ã§ã«ã¼ãããã¨ã
for i in $(seq 1 10) ; do dig -t TXT domain-hoge-${i}.com ; done
$(seq 1 10)ã§1 2 3 4 5 6 7 8 9 10ã®ãªã¹ããä½ããã¨ããã«çç®ãPerlã§è¨ãã¨ããã®ãfor(1..10)çãªãã¨ãåºæ¥ãã®ãæ°ã«å ¥ã£ã¦ããããã¾ãã³ã¼ããæ¸ããããªãé¢åããããå±ã¨ãã¦ã¯ã
for i in {1..10} ; do dig -t TXT domain-hoge-${i}.com ; done
ã¨ãæã£ã¦ãããã©ã$(seq 1 10) ãã{1..10}ã®ã»ããæ¸ãï¼
ç¡éã«ã¼ãããã¨ã
while : ; do i=$((i+1)) ; echo endlessloop:$i ; sleep 1 ; done
bashã§ã¤ã³ã¯ãªã¡ã³ãããã¨ãã¯ã
$((i+1))
ã使ãã®ããã¹ããã©ã¯ãã£ã¹ã£ã½ãã
便å©ãªã«ã¼ããããã
çµæ§æ
£ç¿çã«ä½¿ããããªãã¤ã
ã¤ãã£ãªã ã¨ãã¦è¦ããã ãã§æ¦éå++ãªæãã
è¨å®ãã¡ã¤ã«ãªã©ãèªã¿è¾¼ãã§ã«ã¼ãããã¨ã
while read line; do echo $line done < hoge.conf
readã§æ¨æºå ¥åãåãä»ãã¦å¦çããã¤ãã£ãªã ããã使ãã
ã³ã³ãåºåãã®ãã¡ã¤ã«ãå¦çããã¨ã
while IFS=, read domain uid password ; do echo "domain=${domain} uid=${uid} password${password}" done < account.list
IFSã§ãªã¹ãã®åºåãæåã,ã«å¤æ´ããcsvãªã©ã³ã³ãåºåãã®ãã¡ã¤ã«ãèªã¿è¾¼ã¿å¦çã§ãããããããã使ãã
ãã¤ããï½ï¼ï½ï½
$ for i in {1..10} ; do echo "(/ã»Ïã»)/ $i" ; sleep 1 ; done (/ã»Ïã»)/ 1 (/ã»Ïã»)/ 2 (/ã»Ïã»)/ 3 (/ã»Ïã»)/ 4 (/ã»Ïã»)/ 5 (/ã»Ïã»)/ 6 (/ã»Ïã»)/ 7 (/ã»Ïã»)/ 8 (/ã»Ïã»)/ 9 (/ã»Ïã»)/ 10
Bashã¯ãã£ã¨ã¾ã ã¾ã ããªããªä¾¿å©ã«ä½¿ããããªã®ã§ãã£ã¨åå¼·ãããã¨ããâ¦ã