seq shell
seq用于生成一个序列
seq [option] first increment last
选项:
- -f --format=FORMAT
使用 printf 样式的浮点格式 - -s --separator=STRING
使用指定字符串分隔数字(默认:\n) - -w --equal-width
在数字添加 0 使得宽度相同,后面无参数
-
seq -f'num%04g' 10 -1 5
-
seq -w 10 -1 5
-
seq -w -s',' 10 -1 5
-
seq -s"`echo -e '\t'`" 10 -1 6使用\t分割

-
seq -f"string%03g" -s"`echo -e '\t'`" 1 5
-
seq 4 -1 1 | xargs -I{} echo {}


浙公网安备 33010602011771号