Le 08/07/2013 19:09, Michal Hlavinka a écrit :
Hi,
it seems braceexpand option does not always affect expansions, sometimes
it depends on glob option.
<snip>
Seems braceexpand has no effect. Instead glob options
affects expansion.
a='{1,6}' b='{1..6}'
for i in -braceexpand +glob +braceexpand -glob; do
set ${i%${i#?}}o ${i#?}
set -o | sed -n -e 's/ */ /' -e /glob/p -e /braceexpand/p | tr '\n' '
';echo
print "$a" $a
print "$b" $b
print "{1,6}" {1,6}
print "{1..6}" {1..6}
done
$ uname -a
CYGWIN_NT-6.1 pcvista 1.7.18(0.263/5/3) 2013-04-19 10:39 i686 Cygwin
$ ksh93 -e 'print ${.sh.version}'
Version JM 93u 2011-02-08
$ ksh93 /tmp/f
braceexpand on glob on globstar off
{1,6} 1 6
{1..6} 1 2 3 4 5 6
{1,6} 1 6
{1..6} 1 2 3 4 5 6
braceexpand on glob off globstar off
{1,6} {1,6}
{1..6} {1..6}
{1,6} 1 6
{1..6} 1 2 3 4 5 6
braceexpand off glob off globstar off
{1,6} {1,6}
{1..6} {1..6}
{1,6} {1,6}
{1..6} {1..6}
braceexpand off glob on globstar off
{1,6} 1 6
{1..6} 1 2 3 4 5 6
{1,6} {1,6}
{1..6} {1..6}
well, braceexpand works ok for static values ({x..y}), but not for
dynamic values ($x), is this intended ?
unfortunatelly, {1..5,6} does partly work w/ braceexpand.
$ set -o | sed -n -e 's/ */ /' -e /glob/p -e /braceexpand/p | tr '\n' '
';echo
braceexpand on glob off globstar on
$ print {1..5,6}
1..5 6
Regards,
Cyrille Lefevre
--
mailto:[email protected]
_______________________________________________
ast-developers mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-developers