一些指令問題 - Linux

Table of Contents

小弟最近初學遇到一題不知道怎解

題目是這樣的

Student wants to display 1 to 1000 numbers with an expansion of 2.Meaning
the output should be:1 3 5 7 9 11...Student dont know to write a script.
Please help him with a single command to display this.
Repeat the same to display all alphabets with expansion of 4 so as to display
A E I M

請大家指導一下

--

All Comments

George avatarGeorge2015-10-01
man seq
Christine avatarChristine2015-10-02
bash -c "echo {1..1000..2}"
bash -c "echo {A..Z..4}"
Una avatarUna2015-10-02
bash 沒有 {1..100..2} 這類語法吧,ksh 才支援
Ina avatarIna2015-10-06
不過剛剛看了一下,bash 4.x 有支援沒錯
我被手上跑的 bash 3.x linux server 騙了:~
Skylar DavisLinda avatarSkylar DavisLinda2015-10-07
還在用bash3不怕shellshock?
Frederica avatarFrederica2015-10-11
不過的確bash4加了很多features
Odelette avatarOdelette2015-10-14
centos5的bash還是bash3.2啊 不過有打過patch了XD