huangyingw
huangyingw

Reputation: 119

How to continue looping on failure?

I have following code, which would unrar all the rar file, but it failed on the first rar which require password, and then exit. I tried add "|| true", but no luck

find ./downloaded/ -type f -iname \*.rar | while read ss
do
    ss="$(realpath "$ss")"
    cd "$(dirname "$ss")"
    unrar x -r -o+ "$ss" || true
done

Upvotes: 1

Views: 47

Answers (1)

gapsf
gapsf

Reputation: 644

unrar x -r -p- -o+ "$ss" || true

-p- Do not query password

Upvotes: 1

Related Questions