[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Filename expansion bug
From: |
Greg Wooledge |
Subject: |
Re: Filename expansion bug |
Date: |
Thu, 8 Aug 2019 10:38:48 -0400 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
On Thu, Aug 08, 2019 at 04:33:16PM +0200, Janek Mi wrote:
> For some time in my scripts I was using something like this:
>
> ```shell
> #!/usr/bin/env bash
> shopt -s failglob
> command="echo xyz\(\)"
> $command
> ```
>
> And it was working fine. But somewhere between bash version 4 and 5 I
> realized it generates an error:
> no match: xyz\(\)
This looks just like another recent thread. See Chet's response here:
https://lists.gnu.org/archive/html/bug-bash/2019-08/msg00015.html
And my personal response for this variant of the issue: stop putting
shell commands in string variables and then trying to run them with
unquoted parameter expansion. See:
https://mywiki.wooledge.org/BashFAQ/050