Although it is true that tar works with files, this does not mean that you need to create temporary files yourself, and I would advise him.
You can use process substitution for this (Bash supports what Fish does in slightly different syntax too).
tar cvaf a.tgz <(echo 1.0.0) file1 file2 -P --transform 's:^/.*:VERSION:'
-P ( --absolute-names ) here to identify a temporary file to convert the name to rename. Hope other files are local.
If this is not the case, and some other files are added in absolute ways (which is probably not a common case), then you can either clarify the regexp conversion, or use a two-step solution with creating the archive, and then update it (as Aaron pointed out).
source share