On Thu, Sep 10, 2009 at 07:01:47PM +0200, Roland Mainz wrote:
...> ... and http://www.opensolaris.org/os/project/shell/shellstyle/#math has
Really nice compilation!
RFE: Many users are unaware of ksh subshell patterns as described in
http://oreilly.com/catalog/korn2/chapter/ch04.html#ksh2-ch-4-tab-03
and fallback to pipe through sed/awk/perl - e.g. saw very often
something like ${BLA//\(one|two|three\)/it works}
So another example would be probably helpful. E.g.:
STATUS="$(zpool status)"
printf
"<pre>${STATUS//@(ONLINE|DEGRADED|FAULTED|REMOVED|OFFLINE|UNAVAIL)/<span
class=\"\1\">\1</span>}</pre>"
Regards,
jel.
PS: More complete examples: http://iws.cs.uni-magdeburg.de/~elkner/xVM/ ;-)
--
Otto-von-Guericke University http://www.cs.uni-magdeburg.de/
Department of Computer Science Geb. 29 R 027, Universitaetsplatz 2
39106 Magdeburg, Germany Tel: +49 391 67 12768