9
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

seq コマンド

9
Posted at

シェルスクリプトで指定回数ループ処理

seq 10とやると、1から10まで出力してくれる。

seq 2 10とすると2から10まで出力してくれる。

これを使うと、for文で、1~10までのループとかが簡単に実行出来る。


for i in seq 1 10; do
echo "${i}個目の出力"
done


とすると、

1個目の出力
2個目の出力
3個目の出力
4個目の出力
5個目の出力
6個目の出力
7個目の出力
8個目の出力
9個目の出力
10個目の出力
と出てくれる

9
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?