arfoll / unrarall

bash script to unrar everything and cleanup in a given directory
GNU General Public License v3.0
261 stars 68 forks source link

[BASH 3] Relative path gives error message about UNRARALL_OUTPUT_DIR not being a directory #44

Open johanthoren opened 6 years ago

johanthoren commented 6 years ago

Short description:

If using a relative path with the -o flag, unrarall complains that it's not a directory. When specifying the absolute path there is no error message.

How to reproduce:

Call on unrarall with the -o flag and give it a relative path as argument.

Example:

unrarall -o Movies Downloads

Sidenote:

[[ -d Movies ]] tests as True in the Shell.

Environment details:

OS: MacOS 10.13.3 Bash version: GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin17)

arfoll commented 6 years ago

Thanks for letting us know, I'll mess with it in the morning but in the meantime can you try it out with a modern bash? Bash 4 has been out for nearly 10yrs!

On 7 Mar 2018 22:36, "Johan Thorén" notifications@github.com wrote:

Short description:

If using a relative path with the -o flag, unrarall complains that it's not a directory. When specifying the absolute path there is no error message. How to reproduce:

Call on unrarall with the -o flag and give it a relative path as argument. I.e unrarall -o Movies Downloads Sidenote:

[[ -d Movies ]] tests as True in the Shell. Environment details:

OS: MacOS 10.13.3 Bash version: GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin17)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/arfoll/unrarall/issues/44, or mute the thread https://github.com/notifications/unsubscribe-auth/AAfZZhu94yRbtywJPozQhsbiN5jBjCbJks5tcFLrgaJpZM4ShMmx .

johanthoren commented 6 years ago

I just tested with bash 4 installed and then there is no more error message. It's definitely a bash 3 problem. Explains why I didn't notice it before I made a reinstall of MacOS, since I didn't yet install the bash 4 in my new environment.

Afforess commented 6 years ago

Maybe unrarall should test for the bash version and exit early if it's < 4?

if [ "${BASH_VERSINFO}" -lt 4 ]; then
  echo "$0 only supports bash 4 and higher releases. Please upgrade your version of bash"
  exit 1
fi
arfoll commented 6 years ago

Maybe, thing is without the output stuff it works nicely by default on mac so it's a shame to bork it for everyone :/

On 11 March 2018 at 17:52, Cameron McAvoy notifications@github.com wrote:

Maybe unrarall should test for the bash version and exit early if it's < 4?

if [ "${BASH_VERSINFO}" -lt 4 ]; then echo "$0 only supports bash 4 and higher releases. Please upgrade your version of bash" exit 1 fi

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/arfoll/unrarall/issues/44#issuecomment-372130161, or mute the thread https://github.com/notifications/unsubscribe-auth/AAfZZgvsIrs07HuXtVzTY59HYxKhIRmIks5tdVZkgaJpZM4ShMmx .