gpt4 book ai didi

linux - Head 和 Basename 一起给出由信号 13 终止

转载 作者:太空宇宙 更新时间:2023-11-04 03:46:10 28 4
gpt4 key购买 nike

如何摆脱 find: basename returned by signal 13?我尝试过移动一些东西,寻找 head -1 的替代方案,但我无法弄清楚。

david@server:/hdd_1/handbrake/log$ plex="/hdd_1/plex" && find "$plex" -type f -iname "*.mkv" -exec basename {} \; | head -1
Predestination (2014).mkv
find: `basename' terminated by signal 13
find: `basename' terminated by signal 13
find: `basename' terminated by signal 13
find: `basename' terminated by signal 13
find: `basename' terminated by signal 13
find: `basename' terminated by signal 13
find: `basename' terminated by signal 13
find: `basename' terminated by signal 13
find: `basename' terminated by signal 13
find: `basename' terminated by signal 13

最佳答案

信号 13 表示“管道破裂”。 head 已经得到了它需要的内容并结束了,但是 basename 仍在泵入管道(现在无处通向,因此信号 13)。

试试这个:

plex="/hdd_1/plex" && find "$plex" -type f -iname "*.mkv" | head -1 | xargs basename

关于linux - Head 和 Basename 一起给出由信号 13 终止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28099907/

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