Web lists-archives.com

Re: Zsh and wildcards

On 2/20/2019 4:39 PM, Brian Inglis wrote:
On 2019-02-20 11:13, Mike Brown wrote:
On Tue, Feb 19, 2019 at 11:31:24PM -0700, Brian Inglis wrote:
On 2019-02-19 13:42, Mike Brown wrote:
Zsh 5.3 under Win7-64
I'm trying to do the following:
     mv TSMUXER/*.ac3 TSMUXER/txmuxer.ac3
The problem is the the * is not being expanded.  I have no idea why not.
Any tips will be appreciated.

The command line implies you have a .ac3 file already in TSMUXER and want to
rename it to fixed name txmuxer.ac3. A lack of expansion implies there is no
file matching that pattern. You can prefix simple commands with echo to test
their effect. If a pattern is not expanded, use ls to check what exists in the
source directory, and where it differs from your expectation.

Ah, but the file I want to change the name of is indeed there.  For this
particular run, the name is ".track_2.ac3".

And yes, I did all kinds of testing to see what was being presented.

For the time being I got around it by doing:

     mv TSMUXER/`ls -A TSMUXER` TSMUXER/tsmuxer.ac3

But, I'd rather use the wildcard.  Plus, I'd like to know why it isn't
working and how to fix it.

Dotfiles .* are hidden by default under most shell expansions unless .* is
explicitly specified or shell specific options are specified: for zsh specify
the D glob qualifier *(D), for bash set shopt -s dotglob.

... or just do: mv TSMUXER/.*.ac3 TSMUXER/tsmuxer.ac3

(Note the . after the / !)

Best - EM

Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple