LoginSignup
0
0

More than 3 years have passed since last update.

連続するアルファベットを指定文字数分出力する

Posted at

やりたいこと

  • 連続したアルファベットを指定文字数分生成したい

コード

# 単純なアルファベットの出力はブレーズ展開を使います
echo {A..Z} 
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
  • 指定の文字数
# その中から文字数をUPSのselfを使いました。
echo {A..Z} | self {1..9}
A B C D E F G H I
# 指定文字数
NUM_CH=9
echo {A..Z} | eval self {1..$NUM_CH}
A B C D E F G H I

参考文献

ブレース展開に変数を使う(実行例). eval を使えば解決!
Tukubaiオンラインコマンドマニュアル(self)

0
0
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
0
0