In a bash script, how do I use a variable to create a specifically named zipped file? For example, I would like to do something like:
VERSION_STRING='1.7.3'
zip -r foo.$VERSION_STRING foo
Where I ideally end up with a file called foo.1.7.3.zip
It seems like I’m having 2 problems:
- the zip command is treating
$VERSION_STRINGlike it’s null or empty - the
.afterfooalso seems to be mucking it up
The following works fine here using bash 4.1.5:
I’ve added the
echoto see the actual command rather than run it. The script prints out