zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@sunsite.dk
Subject: Re: scp and globbing in zsh
Date: Fri, 23 Jul 2004 10:47:20 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.61.0407231026100.29347@toltec.zanshin.com> (raw)
In-Reply-To: <23e98abb04072309486560f63e@mail.gmail.com>

On Fri, 23 Jul 2004, matt m wrote:

> $ scp someserver:~/tmp/*.txt  .
> $ scp *.txt  someserver:~/tmp/
> 
> I could just put single quotes around the server path to get it to work 
> with globbing but after many years of bash I am having trouble getting 
> into the habbit of using single quotes with scp

I suspect that you just want "setopt no_nomatch" so that the glob pattern 
is left unexpanded when it doesn't find any matching files.  (You may have 
to "unsetopt null_glob csh_null_glob" as well.)  That's the only way I can
think of that this would do as you seem to expect in bash but not in zsh.

If for some reason you want "nomatch" behavior for other commands but not
for scp, you have to play some games of this sort:

  glob_scp() {
    emulate -L zsh
    array args
    local a
    for a
    do
      if [[ $a = *:* ]]
      then
        args=( $args $a )	# args+=($a) if you have zsh 4.2+
      else
        args=( $args $~a )	# args+=($~a)
      fi
    done
    scp $args
  }
  alias scp='noglob glob_scp'


  parent reply	other threads:[~2004-07-23 17:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-23 16:48 matt m
2004-07-23 17:05 ` Peter Stephenson
2004-07-23 17:23   ` matt m
2004-07-23 17:37   ` Wayne Davison
2004-07-23 17:47 ` Bart Schaefer [this message]
2004-07-23 20:24   ` Vincent Lefevre
2004-07-24 18:35     ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.61.0407231026100.29347@toltec.zanshin.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).