[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#64607: parted command is not support Brace Expansion in bash shell
From: |
bill-auger |
Subject: |
bug#64607: parted command is not support Brace Expansion in bash shell |
Date: |
Fri, 14 Jul 2023 04:10:49 -0400 |
On Fri, 14 Jul 2023 10:17:58 +0700 Nguyen wrote:
> parted /dev/sd{c,d,e} print --> NOT OK
>
> Is it a bug or a feature still not available?
>
> Is it possible add more codes for parted to support Brace Expansion in bash
> shell?
not a bug; and not related to the shell - the feature simply does not exist
when you try that you will notice the "Usage" BNF
Usage: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]...]...]
that is a very specific form which specifies how to pass arguments - the way to
read that is to notice the square brackets [] and the ellipsis ...
square brackets denote optional arguments, and the ellipsis denote that multiple
of the preceding argument may be given - in this case, the command may take
only zero or one 'DEVICE' argument, but may have zero or multiple 'OPTION',
'COMMAND', and 'PARAMETERS'
so this is not related to shell brace expansion - the program expects only one
device argument - of course, someone could add that feature, but my guess is
that it was deemed undesirable for some reason, or it probably would have been
implemented long ago
to get the result you wanted, you could run it multiple times
$ for device in /dev/sd{c,d,e} ; do parted $device print ; done ;