Home > database >  How to continue looping on failure?
How to continue looping on failure?

Time:09-23

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

CodePudding user response:

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

-p- Do not query password

  •  Tags:  
  • bash
  • Related