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

Re: scp and noglob



On Mon, 29 Nov 2004, Jens Kubieziel wrote:

> scp $SERVER:*.c .
> Zsh tries to expand *.c and I have to insert a 'noglob'. Is there a way
> to tell zsh to don't expand all filenames which are on the serverside?

If you have zsh 4.2.x, try the url-quote-magic widget that's included in
the Functions/Zle directory in the distribution.  Load it like this:

  autoload -U url-quote-magic
  zle -N self-insert url-quote-magic

Then trick it into treating any hostname as a URL scheme when the command 
name is "scp", by doing this (note placement of single/double quotes):

  zstyle -e :urlglobber url-other-schema \
    '[[ $words[1] == scp ]] && reply=("*") || reply=(http https ftp)'

(Read the comments in the function file for an explanation of why the 
context is ":urlglobber", if you care.)

Then just type your scp command and watch what happens.



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