I have a folder that I download from Dropbox using a shared link (not public link) and curl. It is downloaded as a zipped folder. I need to unzip this folder using unzip in a bash shell script. Whenever the folder is unzipped, I get the following errors:
warning: stripped absolute path spec from /
mapname: conversion of failed
Just to make sure that it was not a weird issue with curl, I downloaded the folder directly from Dropbox and tried it again. I got the same error. All of the files and subdirectories appear, and there does not seem to be any problem with their integrity. Unzipping either folder with the GUI results in no error messages.
I ran unzip -l and noticed an odd first entry:
Length Method Size Ratio Date Time CRC-32 Name
-------- ------ ------- ----- ---- ---- ------ ----
0 Defl:N 2 0% 01-23-14 19:38 00000000 /
I believe that it is this empty directory that is causing the issues. My question is, is there any way to ignore this empty directory or to suppress the error messages (I tried -qq with no luck)? Or, is there something that I am doing wrong/missing?
I have tested this on Mac OSX 10.9.1
and Ubuntu Linux (Version Unknown)
with the same results.
EDIT: I also tested it with jar xf
and it works fine without any errors. Running jar xvf
shows that it created: /
. I still think it is this empty, unnamed directory that is causing the issue, but I can't seem to get my syntax right so that unzip will ignore it. I would just use jar, but I need to be able to specify an output directory.
unzip /path/to/filename.zip filename.ext file2.ext
to extractfilename.ext
andfile2.ext
from the archive. – Rapscallion2> /dev/null
. Also, you can exclude the problem children with-x
as another option. – Rapscallion$?
to verify that the exit code is 0. It's possible that warnings will also give nonzero exit codes, but you can see what the exit code for warnings is and check for that also. – Rapscallion