I would like to zip all files/dirs while excluding a few listed within the variable $excludes. However the following piece of code is not excluding those files. Please help! Thanks!
excludes='"dir1/*" "dir2/*" "dir3/*"'
zip -r zipfile * -x $excludes
This should work:
zip -r zipfile * -x dir1/* dir2/* dir3/*
Or even this should work:
excludes='dir1/* dir2/* dir3/*' zip -r zipfile * -x "$excludes"
Have you tried escaping the asterisk with a backslash: