zip folder in bash

Viewed 6503

I have the files and folder like the below:

/myproject/config/1.xml
/myproject/src/1.py

I now zip the file like this using bash script:

cd myproject
zip -9 -r -q myfile.zip ./src/*
zip -9 -q myfile.zip ./config/1.xml

The zip file has 2 folders now, 1 config and 1.xml in it and 1 src and 1.py in it. This is what I want, the 2 folders are at the same level in the zip file.

Now I have to move the config folder out a level, src folder remains.

/config/1.xml
/myproject/src/1.py

I can change the codes to the below:

cd myproject
zip -9 -r -q myfile.zip ./src/*
zip -9 -q myfile.zip ../config/1.xml

But the folder config is no longer in the same level as the src.

What am I missing here?

1 Answers
Related