命令行生成数列:{}和seq

如何在命令行上产生一列数字呢?

  • {START..END..INCREMENT}
  • {1..3}{a..c}
  • seq -s ‘,’ START INCREMENT END,使用方式$(seq -s ‘,’ START INCREMENT END)

  • awk中的使用技巧:
    1
    2
    echo "$"$(seq -s ',$' 20)
    $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20

    More:http://www.thelinuxrain.com/articles/building-sequences-of-numbers-on-the-command-line

    tiramisutes wechat
    欢迎关注