小编new*_*log的帖子

Bash脚本删除文本文件中的所有行,直到字符串

我有一个包含很多单词的文件:

one
two
three
four
tree
house
cat
dog
etc
Run Code Online (Sandbox Code Playgroud)

我想删除所有单词,直到"house"以这样的方式获取:

cat
dog
etc
Run Code Online (Sandbox Code Playgroud)

unix bash shell scripting filter

2
推荐指数
1
解决办法
1280
查看次数

文本文件乘以bash linux

例如,我有一个包含5行的文本文件:

one
two
three
four
five
Run Code Online (Sandbox Code Playgroud)

我想制作一个脚本来制作一个包含上面文件循环的2000行文件,它看起来像

    one
    two
    three
    four
    five
    one
    two
    three
    four
    five
    one
    two
    three
    four
    five
 ............repeat until n times is reached
Run Code Online (Sandbox Code Playgroud)

bash text file lines repeat

2
推荐指数
2
解决办法
2938
查看次数

标签 统计

bash ×2

file ×1

filter ×1

lines ×1

repeat ×1

scripting ×1

shell ×1

text ×1

unix ×1