一些指令問題 - Linux

Elizabeth avatar
By Elizabeth
at 2015-09-28T11:56

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

請大家指導一下

--
Tags: Linux

All Comments

George avatar
By George
at 2015-10-01T15:13
man seq
Christine avatar
By Christine
at 2015-10-02T08:32
bash -c "echo {1..1000..2}"
bash -c "echo {A..Z..4}"
Una avatar
By Una
at 2015-10-02T22:23
bash 沒有 {1..100..2} 這類語法吧,ksh 才支援
Ina avatar
By Ina
at 2015-10-06T11:04
不過剛剛看了一下,bash 4.x 有支援沒錯
我被手上跑的 bash 3.x linux server 騙了:~
Skylar DavisLinda avatar
By Skylar DavisLinda
at 2015-10-07T12:02
還在用bash3不怕shellshock?
Frederica avatar
By Frederica
at 2015-10-11T09:36
不過的確bash4加了很多features
Odelette avatar
By Odelette
at 2015-10-14T03:19
centos5的bash還是bash3.2啊 不過有打過patch了XD

Arch Linux 的滾動性更新有包含內核嗎?

Megan avatar
By Megan
at 2015-09-27T20:04
如題,目前我使用 arch linux 最新版的核心 4.1.16,但在我的 Chrombook (已完整移除 Chrome OS)會有些問題 (如聲音、觸控板無效)。據說剛釋出的 linux 4.2.1 kernel 有完整支援 Chrombook 硬件。 我知道可以自行編譯內核,但程序上實顯繁雜;然後 ...

curl & tar 使用問題

Tom avatar
By Tom
at 2015-09-27T13:07
curl https://www.kernel.org/pub/linux/kernel/v2.6/longterm/v2.6.32/linux-2.6.32.68.tar.xz tar xJf - -C ./linux_kernel_src 解壓後 linux-2.6.32.68.tar.xz , 會 ...

nginx的設定

Agnes avatar
By Agnes
at 2015-09-27T05:49
※ 引述《ireullin (raison detre)》之銘言: : 以下是我nginx的設定 : 我想要做成一台機器上有兩個不同的網站 : 然後靠url第一層的path去區分 : 以下例來說就是 127.0.0.1/kaoru 與 127.0.0.1/test 分別是兩個不同的站台 : 但我現在遇到的問題 ...

觀看先鋒影片

Edward Lewis avatar
By Edward Lewis
at 2015-09-26T09:21
有找過github上的但只有JJ(吉吉)可用,請問有相關資料嗎 -- Sent from my Android - ...

雙網卡(wlan0 ,eth0)同時sock收資料

Ophelia avatar
By Ophelia
at 2015-09-26T00:57
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.1.1 0.0.0.0 UG ...