seq shell

 

seq用于生成一个序列

seq [option] first increment last

选项:

  1. -f --format=FORMAT 使用 printf 样式的浮点格式
  2. -s --separator=STRING 使用指定字符串分隔数字(默认:\n)
  3. -w --equal-width 在数字添加 0 使得宽度相同,后面无参数

 

 

  1. seq -f'num%04g' 10 -1 5

     

     

  2.  

    seq -w 10 -1 5

     

     

  3.  

    seq -w -s',' 10 -1 5

     

     

  4.  

    seq -s"`echo -e '\t'`" 10 -1 6

    使用\t分割

     

     

  5.  

    seq -f"string%03g" -s"`echo -e '\t'`" 1 5

     

     

  6.  

    seq 4 -1 1 | xargs -I{} echo {}

     

     

     

     

      

 

posted @ 2020-09-22 10:36  ascertain  阅读(148)  评论(0编辑  收藏  举报