This week's book giveaway is in the Design and Architecture forum. We're giving away four copies of Communication Patterns: A Guide for Developers and Architects and have Jacqui Read on-line! See this thread for details.
The '$' dereferences environment variables in Unix shells. The leading and trailing '%' dereferences the same in Windows. You have it right with every other variable in your script.