Directory structure:
/home
---ubuntu
------projects
---------project1
---------project2
---------project3
------.ignore
.ignore:
*project1* *project2*
If I run:
zip -r zipush.zip projects -x "$(< .ignore)"
Then it creates a zip containting all three projects - which is a wrong result. I want it to ignore project1 and project2.
However, it does work well when I write the arguments explicitly:
zip -r zipush.zip projects -x *project1* *project2*
But I don't understand why, because "$(< .ignore)" seems to work well when I type for example:
echo "$(< .ignore)"
Output:
*project1* *project2*
First, change your .ignore file to this:
project1/*
project2/*
Second, change your -x
switch to -x@.ignore
.
No comments:
Post a Comment