如何摆脱find: basename terminated 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
答案 0 :(得分:0)
可能与空间有关。
试试这个:
plex="/hdd_1/plex" && find "$plex" -type f -iname "*.mkv" -print0 | xargs -0 basename | head -1
答案 1 :(得分:0)
信号13表示"断管"。 head
已经得到了它所需要的东西并且已经结束了,但是basename
仍在进入管道(现在无处可去,因此信号13)。
试试这个:
plex="/hdd_1/plex" && find "$plex" -type f -iname "*.mkv" | head -1 | xargs basename