zsh-users
 help / color / mirror / code / Atom feed
From: "jdh" <dhenman@gmail.com>
To: <zsh-users@zsh.org>
Subject: Re: is there a way to use *.{txt,zip,tbz,dmg} if one or more might be
Date: Sun, 07 Jul 2019 16:39:48 -0700	[thread overview]
Message-ID: <20190707163948.6202@Huxley> (raw)


There shold be two ways to do that;

      1.)  Using extended flags

      	   	 setopt nullglob        # this will last throughout your session


or     2.) Add the 'N' flag like this:

      	         ls *.{txt,pdf,ods,odg,jpg}(N)   # this is on a singular basis


	You may need to prefix the 'N' like this (#QN) but I didn't have to.

       	         ls *.{txt,pdf,ods,odg,jpg}(#qN)


TJ Luoma <luomat@gmail.com> wrote:

> This seems like one of those things that I might have not learned that
> everyone else knows, so I thought I'd ask.
> 
> I can use this:
> 
>         mv -vn *.{txt,zip,tbz,dmg} ~/dir/
> 
> to move all files that end with zip/txt/tbz/dmg to ~/dir/
> 
> BUT it will fail if it does not find at least one file with each of
> those extensions.
> 
> Is there a way to do basically the same thing, but tell `mv` "if is at
> least one file with any of these extensions, then move to ~/dir/" ?
> 
> I suppose I could use `find` with various `-o` flags, but I was
> wondering if there was an easier way.
> 
> Thanks!
> 
> Tj
> 
> --
> TJ Luoma
> TJ @ MacStories
> Personal Website: luo.ma (aka RhymesWithDiploma.com)
> Twitter: @tjluoma

             reply	other threads:[~2019-07-07 23:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-07 23:39 jdh [this message]
     [not found] <20190707163948.6202__37372.3986953095$1562542863$gmane$org@Huxley>
2019-07-21 19:11 ` Stephane Chazelas

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=20190707163948.6202@Huxley \
    --to=dhenman@gmail.com \
    --cc=zsh-users@zsh.org \
    /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).