Unzip the file using Execute Command activity

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
svga
Participant
Posts: 73
Joined: Thu Aug 07, 2008 6:31 am
Location: Syracuse

Unzip the file using Execute Command activity

Post by svga »

Hi, I have a requirement where I need to unzip the input file. I used the command "unzip" in Execute Command activity.

eg: unzip /da/st/test.zip

I need all files in the zip to be unzipped in the same directory.. that means in the /da/st/ directory

Can anyone please help me to achieve this?

Thanks a lot for ur help.
vinothkumar
Participant
Posts: 342
Joined: Tue Nov 04, 2008 10:38 am
Location: Chennai, India

Post by vinothkumar »

Try with this
unzip /da/st/test.zip -d
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What is "ur help"?

Ur was a city in ancient Babylonia. The second person personal pronoun in English is spelled "you" or, in possessive case, "your".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: Unzip the file using Execute Command activity

Post by chulett »

svga wrote:I used the command "unzip" in Execute Command activity.
OK, what happened? If there was an error, what was it?

As noted, the "-d" option specifies an output directory to extract everything to, however it needs to be followed by the desired directory. Otherwise I suspect it unzips it to the current working directory which I again suspect is the original issue.

Two examples, one with and one without the override:

Code: Select all

unzip /da/st/test.zip -d /da/st

cd /da/st && unzip test.zip
Either should work, I would wager.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply