There is a bug in geshi 1.0.7.21 (the version included with dokuwiki-2008-05-05):
http://sourceforge.net/tracker/index.php?func=detail&aid=1926259&group_id=114997&atid=670231
Replacing inc/geshi.php and inc/geshi/ with version 1.0.8 fixes the problem.
The actual problem occurs when using a "${VAR}" variable in a "<code bash>" block - an extra "|>" is append on after ${VAR}, leaving you with "${VAR}|>" once the syntax is rendered (the |> never shows up in the source document).