2012-11-26 66 views
3

我需要打印的東西是這樣的:猛砸字母列表生成

a 
b 
c 
. 
. 
. 
z 
A 
B 
C 
. 
. 
. 
Z 
0 
1 
2 
. 
. 
. 
9 

這個是可以分開做,但。

for f in {a..z}; 
    do   
    echo $f; 
done 
for f in {A..Z}; 
    do   
    echo $f; 
done 

for f in {0..9}; 
    do   
    echo $f; 
done 

但我怎麼能在一個呢?也許這樣?但沒有工作。

for f in {a..z:A..Z:1..9}; 
    do   
    echo $f; 
done 

回答

7
for f in {a..z} {A..Z} {0..9}; do 
    echo "$f" 
done 
3

或者,如果你只是想打印出來:

printf "%s\n" {a..z} {A..Z} {0..9}