Thanks again for the suggestion. You've kept me persuing this! After experimenting, then reading the man pages for bash, I found out a couple things. Aliases don't allow for passing arguments. You are supposed to used shell funtions for that. O.K. Now how do I translate my command string into a shell function that works? tardy () { (cd $1; tar cf - .) | (cd $2; tar xpfS - ); } ?????? No. This completely fails, because piping doesn't appear to work in shell functions. (I really didn't expect it would.) In fact, this makes a horrible mess with tar trying to extract back into the source directory structure. So, How do I write a shell function to do what I want??? -Gerry linux@darykon.cet.com On Thursday 04 Sept 2003 Nick LeRoy wrote:
On Thursday 04 September 2003 6:07 pm, Linux Mailing lists account wrote:
I've fought with this for too long!
I have a favorite command for copying file structures on my BSD system. It's:
(cd !:1; tar cf - .) | (cd !:2; tar xpf -)
Well, I've never set it up as an alias, but at the shell I routinely do something like:
$ cd /some/dir; tar cf - . | ( cd /dest/dir; tar xvpfS - )
So, I'd think that you'd want to do something like:
alias tarcp='cd $1; tar cf - . | ( cd $2; tar xfpS - )'
Can someone, PLEASE, tell me how to translate this to bash?
Thanks!!
Hope this helps
-Nick