Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • 1
    I think it's just because the outer double quotes don't prevent $2 from being expanded by the local shell (the inner single quotes are not special in this context). So you're passing zmv '(xxx_)(*)' 'yyy_' to the remote shell. Try yyy_\$2. Commented Jun 28, 2020 at 23:47
  • Thank you very much @steeldriver. That works. Sorry for writing such a long question to reveal such a basic mistake. I'll wait a while to see if anyone else has comments (I'd love to get my head round the -w/-W syntax), but I'll be pleased to accept your answer. Commented Jun 29, 2020 at 9:57