gpt4 book ai didi

linux - 删除文本文件中的奇数行

转载 作者:太空狗 更新时间:2023-10-29 11:24:59 25 4
gpt4 key购买 nike

文件:

/home/USER/DIR/a
http://www.here.is.a.hyper.link.net/
/home/USER/DIR/b
http://www.here.is.another.hyper.link.net/

需要删除此文件中的所有奇数行 (PUBLIC-DIRECTORY-LIST)?它用于我的批处理脚本,可以在下面找到(dropbox batch puburl creator):

for PATH in `cat LIST`
do
echo $PATH
dropbox puburl $PATH
done > PUBLIC-DIRECTORY-LIST

我是否只是在脚本末尾附加命令来修剪 PUBLIC-DIRECTORY-LIST

最佳答案

# awk 'NR%2==0' file
http://www.here.is.a.hyper.link.net/
http://www.here.is.another.hyper.link.net/

关于linux - 删除文本文件中的奇数行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1612396/

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