Linux Shell ????????????
???????????? ???????[ 2015/10/15 13:19:03 ] ?????????????? ????
????????linux???鶨?壬????????????????linux shell ??????? ??????? seq??ü??? ?????????????????Ч????list ??????????????鷽????
???????seq?????????
????[chengmo@centos5 shell]$ aNumList=$(seq 100);
????[chengmo@centos5 shell]$ echo $aNumList
????1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
????aNumList???????????????????????????????linux???棬?????????????list. ???????for…in ????????
????[chengmo@centos5 shell]$ for i in $aNumList;do echo $i;done;
????……
??????????????array??????$(seq 100) ????”()”???ɡ?
????[chengmo@centos5 ~]$ aNumList=($(seq 100));
????[chengmo@centos5 ~]$ echo $aNumList
????[chengmo@centos5 ~]$ echo ${
????#aNumList[@]}
????100
??????????100?????顣
??????????????{begin..end}????
???????????????seq????????????????????ɡ?
????[chengmo@centos5 ~]$ echo {1..10}
????1 2 3 4 5 6 7 8 9 10
????[chengmo@centos5 ~]$ for a in {1..10};do echo $a;done;
??????????????
????[chengmo@centos5 ~]$ time echo {1..100}
????1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
????real 0m0.000s
????user 0m0.001s
????sys 0m0.000s
????[chengmo@centos5 ~]$ time echo $(seq 100)
????1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
????real 0m0.003s
????user 0m0.002s
????sys 0m0.001s
??????????????????{begin..end}????seq????????????? ?????????????????????????????ɡ?
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11