Thursday, July 27, 2017

Read command line arguments from a file



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

11.10 - Can&#39;t boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...