gpt4 book ai didi

linux - 在 Linux 中 : How to repeat multiple lines in a file in the same order?

转载 作者:塔克拉玛干 更新时间:2023-11-03 02:05:23 25 4
gpt4 key购买 nike

输入文件包含以下行:

a
b
c

我希望输出为(n 次):

a
b
c
a
b
c

我试过下面的命令,但它不保持顺序

while read line; do for i in {1..4}; do echo "$line"; done; done < file

但是输出是

a
a
b
b
c
c

最佳答案

seqxargs 一起使用:

seq 2 | xargs -Inone cat file

关于linux - 在 Linux 中 : How to repeat multiple lines in a file in the same order?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42594074/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com