I just wanted to share the "pairs" trick, but yeah, there's certainly more you can do, and with the ${} construct more generally too. (did someone say "man sh"?)
On a side note, parameter expansion is apparently one of the areas where bash differs from plain sh, and not everything you can do will be portable. This kind of matching (both shortest and longest match) is, though.
no subject
Date: 2010-11-03 01:35 am (UTC)On a side note, parameter expansion is apparently one of the areas where bash differs from plain sh, and not everything you can do will be portable. This kind of matching (both shortest and longest match) is, though.