Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

how can I make a local directory be a symlink to a remote one?



Folks,

How can I make a local directory be a virtual symbolic link to a remote
directory? (Where "remote" means accessible via ssh(1) and friends.)

For example, I'd like file copies (cp(1)'s) to and from my local ~/foo
directory to actually be scp(1)'s to and from my remote ~/foo directory,
and ls(1)'s of my local ~/foo directory to actually be ssh(1)-invoked
ls(1)'s of my remote ~/foo directory. In the first case, I could
implement this with a script that, say, checked for commands of the form
"cp file ... ~/foo", rewriting them as "scp file ... rhost:~/foo", but
that seems inelegant.

Can anyone point me to a Zsh idiom or meme that would permit me to do
this? Or is this better implemented in some non-Zsh way?

On a more general note, does Zsh support or has anyone fashioned Zsh
functions so that particular commands have directory-specific meanings?

I've been using the shell since 1990, yet I confess I'm only using a
fraction of its capabilities.

Regards,
Eric
--
"Tracks exist at the interface where the sky drags along the surface of the
earth." --Tom Brown, Jr.

Eric De Mund <ead@xxxxxxxxx> | Ixian Systems, Inc. | 53 49 B2 23 AF 6C 20 81
http://www.ixian.com/ead/    | Mountain View, CA   | ED DD 4C 81 AA C9 D1 A5



Messages sorted by: Reverse Date, Date, Thread, Author