Help us understand the problem. What is going on with this article?

seq コマンド

More than 1 year has passed since last update.

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

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個目の出力
と出てくれる

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away