bash brace expansion won't output two zero
Hi all,
I found one issue when using bash brace expansion. I want to output test0050 to test0100, so I used following: [root@centos-doxer pping]# echo test0{050..100} test050 test051 test052 test053 test054 test055 test056 test057 test058 test059 test060 test061 test062 test063 test064 test065 test066 test067 test068 test069 test070 test071 test072 test073 test074 test075 test076 test077 test078 test079 test080 test081 test082 test083 test084 test085 test086 test087 test088 test089 test090 test091 test092 test093 test094 test095 test096 test097 test098 test099 test0100 However, as you may see, test050 to test099 was the result, while what I want is test0050 to test0099. Could any one help on this? Thanks. |
Hi,
try Code:
echo test{0050..0099} Code:
echo test00{50..99} Code:
echo test{0050..0100} Evo2. |
Thanks, but I tried:
Code:
echo test{0050..0100} Code:
[root@centos-doxer tmp]# echo test{0050..0100} Quote:
|
Hi,
what shell are you using? Evo2. |
Hi Evo2,
I'm using bash. I tried ksh, but the same result. Quote:
|
Hi,
sorry I should have asked what version. I know it works on 4.2 an greater, but I've seen it not work on 3.2. Check the section called "Brace Expansion" in the bash man page. If your version of bash supports this feature it should mention it. Eg from bash 4.3.0 man page: Code:
A sequence expression takes the form {x..y[..incr]}, where x and y are either inte‐ |
Thanks a lot Evo2.
I tried on one CentOS 6.3 box with bash-4.1.2 and it worked as expected: [root@centos63~]# rpm -qa|grep bash bash-4.1.2-9.el6_2.x86_64 [root@centos63~]# [root@centos63~]# [root@centos63~]# echo test{0050..0100} test0050 test0051 test0052 test0053 test0054 test0055 test0056 test0057 test0058 test0059 test0060 test0061 test0062 test0063 test0064 test0065 test0066 test0067 test0068 test0069 test0070 test0071 test0072 test0073 test0074 test0075 test0076 test0077 test0078 test0079 test0080 test0081 test0082 test0083 test0084 test0085 test0086 test0087 test0088 test0089 test0090 test0091 test0092 test0093 test0094 test0095 test0096 test0097 test0098 test0099 test0100 Quote:
|
All times are GMT -5. The time now is 06:24 PM. |