[plug] Bash script help

James Devenish devenish at guild.uwa.edu.au
Mon May 3 19:13:52 WST 2004


In message <20040503110301.GA23074 at mail.guild.uwa.edu.au>
on Mon, May 03, 2004 at 07:03:01PM +0800, James Devenish wrote:
> (2) In zsh, you can specify a range like "5 to 12" using
> "/dev/sda<5-12>"

In message <20040503110320.GM21081 at blackham.com.au>
on Mon, May 03, 2004 at 07:03:20PM +0800, Bernard Blackham wrote:
> Use zsh (: /dev/sda{1..12}

Note that the difference between the two is as follows: <1-12> is a
'globbing' pattern, which can match the numbers 1 to 12 (including 01,
02, 03, etc, not just 1, 2, 3). {1..12}, on the other hand, expands to
text. So, /dev/sda{89..90} would generate "/dev/sda89 /dev/sda90"
whereas /dev/sda<89-90> would try (and fail) to match such filenames. In
Brad's case, he can happily use either syntax. Note that this is also
the difference between (a|b|c) and {a,b,c}.





More information about the plug mailing list