4 ms·
This is a bit of a pet peeve of mine, but cd/tar should likely be joined with && - in other words, in what directory do you want tar to (not) run if cd fails?
by dmckeon 13y ago
This is a bit of a pet peeve of mine, but cd/tar should likely be
joined with && - in other words, in what directory do you want tar
to (not) run if cd fails? So consider:
% (cd /foo && tar cpf - .) | ssh bar '(cd /baz && tar xpf -)'
or explore something like:
% rsync -aSHx --update --delete -e ssh /foo/ user@bar:baz/.
- webreac 13y agoGNU tar has evolved and can use simpler syntax: % tar cp -C /foo . | ssh bar tar xp -C /baz
- jfb 13y agoIt would be an interesting project to look at people's shell usage and try to determine when they started using Unix. I have loads of Irixisms that have only recently been crowded out of my head by Darwin BSDism.