Zipping files

Hi Guys,

The script below works but it creates a zip folder under

123_arch.zip
    -- test1
       -- orig1.txt
       -- orig2.txt
       -- orig3.txt
       -- orig4.txt

I don't want the sub directory test1 but everything under the base *arch name

I can not create a long name with all the files because I am getting any extract from a db.

zip 'zip/test1/123_arch.zip' 'oldDir/orig1.txt';
zip 'zip/test1/123_arch.zip' 'oldDir/orig2.txt';
zip 'zip/test1/123_arch.zip' 'oldDir/orig3.txtF';
zip 'zip/test1/123_arch.zip' 'oldDir/orig4.txt';

Thank you for any help :eek:

I think you accidentally forgot to post your script.

I can see it. This is the code in the .sh file

zip 'zip/test1/123_arch.zip' 'oldDir/orig1.txt';
zip 'zip/test1/123_arch.zip' 'oldDir/orig2.txt';
zip 'zip/test1/123_arch.zip' 'oldDir/orig3.txtF';
zip 'zip/test1/123_arch.zip' 'oldDir/orig4.txt';

---------- Post updated at 09:10 PM ---------- Previous update was at 04:13 PM ----------

Do you need additional information ? I am new to this

Thanks for any help!

I have been trying and failing to find any path-related options in zip. I don't knokw why it's bothering to store paths when you're not using -r, AFAIK it shouldn't do that.

You can try this:

cd oldDir ; zip '../zip/test1/123_arch.zip' 'orig1.txt'; cd ..
1 Like

Changing to zip -j fixed my problem

-j Store just the name of a saved file (junk the path), and do not store directory names. By default, zip will store the full path (relative to the current path).

1 Like