The following command:
tar -C "${HOME}/temp" -zcvf uber-bundle.tgz temp
fail with the following error:
tar: temp: Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errors
However a slightly different command works, albeit generating a tar with incorrect directory structure:
tar -C "${HOME}/temp" -zcvf uber-bundle.tgz ~/temp
tar: Removing leading `/' from member names
...
It is clear that -C option fail to change the current directory of tar to ${HOME}, making directory unrecognizable. What went wrong and how to fix it?