如何在 shell 腳本中執行 find 命令而不收到錯誤訊息“missing argument to `-execdir'”?

如何在 shell 腳本中執行 find 命令而不收到錯誤訊息“missing argument to `-execdir'”?

這工作正常:

$ find /home/me/folder -type f -iname "*.rar" -execdir unrar x -o- {} \;

但是對於這個腳本它不起作用:

#!/bin/bash
find /home/me/folder -type f -iname "*.rar" -execdir unrar x -o- {} \;

您能給我提示為什麼會出現此錯誤訊息嗎?

$ ./unrar_script.sh
find: missing argument to `-execdir'

相關內容