To make my environment deployable, I occasionally tar up some handy files and scripts:tar -czvf env.tgz .vimrc .vim/ bin/lsl bin/sI would like to add .bashrc to the mix, but I have some sensitive information in there so I maintain .bashrc-deploy which I can then simply rename once the tarball is on the new server. However, I would really like to have the tarball have the correct name .bashrc from the get-go so that I would not have to rename. I considered writing a script which would temporarily rename the files and make the tarball, like so:#!/bin/bashmv .bashrc .bashrc-realmv .bashrc-deploy .bashrctar -czvf env.tgz .bashrc .vimrc .vim/ bin/lsl bin/smv .bashrc .bashrc-deploymv .bashrc-real .bashrcHowever, does tar have any internal way of storing someFile with the name anotherName in the tarball?
Tar a file with a different name
filenames;tar
One way you could do this is a chainload.In .bashrc:#!/bin/bash# ...# Non-private information# ...[[ -r ~/.bashrc-private ]] && . ~/.bashrc-privateThen put (only) your private stuff in ~/.bashrc-private and everything else in ~/.bashrc. Then just deploy ~/.bashrc.