I'm trying to test if an archive has all its files. All I need to do is a simple unzip and then make. The shell keeps trying to interpret arguments like -aoq as a program. Other errors exist as well, but I'll spare readers each and every way not to do it. Here are some of the failed attempts:Failed:RESULT=$(unzip -aoq cryptopp563.zip -d $TMP/cryptopp563-zip/)if [[ $RESULT -eq 0 ]]; then ... fi;RESULT=$(unzip (-aoq cryptopp563.zip -d $TMP/cryptopp563-zip/))if [[ $RESULT -eq 0 ]]; then ... fi;RESULT=$(unzip (-aoq cryptopp.zip -d $TMP/cryptopp-zip/))if [[ $RESULT -eq 0 ]]; then ... fi;RESULT=$(unzip -aoq cryptopp563.zip -d $TMP/cryptopp563-zip/)if [[ $RESULT -eq 0 ]]; then ... fi;RESULT=$(unzip {-aoq cryptopp563.zip -d $TMP/cryptopp563-zip/})if [[ $RESULT -eq 0 ]]; then ... fi;RESULT=$(unzip (-aoq cryptopp563.zip -d $TMP/cryptopp563-zip/))if [[ $RESULT -eq 0 ]]; then...If I see one more question and answer that says just use parenthesis, just use quotes or just use curly braces I think I am going to scream...How do I call unzip with arguments so that Bash does not try to interpret the arguments as commands?Here's a couple of the more comical error messages:unzip:  cannot find or open {-aoq cryptopp563.zip -d /tmp/cryptopp563-zip/}, {-aoq cryptopp563.zip -d/tmp/cryptopp563-zip/}.zip or {-aoq cryptopp563.zip -d /tmp/cryptopp563-zip/}.ZIP.unzip:  cannot find or open (-aoq cryptopp563.zip -d /tmp/cryptopp563-zip/), (-aoq cryptopp563.zip -d/tmp/cryptopp563-zip/).zip or (-aoq cryptopp563.zip -d /tmp/cryptopp563-zip/).ZIP.Here are a few questions/answers that did not work for me. I'm fairly certain I have visited U&L.SE, Stack Overflow and Super User multiple times.Bash: convert command line arguments into arrayPassing arrays as parameters in bashhow to pass an array argument to the bash scriptPassing array values to command args
How to provide command arguments as an array?
bash;command;arguments
The first one:RESULT=$(unzip -aoq cryptopp563.zip -d $TMP/cryptopp563-zip/)should run unzip just fine, and drop its output to the variable RESULT. However, unzip doesn't print much in its standard output (well, unless with unzip -l), so I think you actually want the return value. Which can be found in $? after the assignment and command substitution, or just after running the program as normal:unzip -aoq cryptopp563.zip -d $TMP/cryptopp563-zip/if [ $? -eq 0 ] ; then echo ok ; fi(And yes, you could just if unzip ... ; then ....)You don't really have an array there, though, just a bunch of normal parameters to the command. This would make an array, print its length and pass it as arguments to unzip:A=(-aoq cryptopp563.zip -d $TMP/cryptopp563-zip/)echo ${#A[@]}unzip ${A[@]}   # note the quotes