I have a Zip file with a hyphen at the start of its name, let's say '- stuff.zip'
If I need to move or copy the file, this means that I need to use a double-hyphen so that the filename isn't interpreted as an option :
cp -- '- stuff.zip' '- stuff2.zip'
However, if I try to use unzip with this file, that doesn't work:
unzip -l -- '- stuff.zip'
error: -fn or any combination of -c, -l, -p, -t, -u and -v options invalid
I have tried all the combinations of simple and double quotes, backslashes, filename in variable that I could think of, and I can't make it work. I can't rename the file, as the script will run on a read-only filesystem.
One thing that does work is using find :
find -maxdepth 1 -name '- stuff.zip' -exec unzip -l {} \;
But it is very inconvenient.