Check the D3 Ref, look for "@ Shell Variable". There are a bunch of them in there.
I wrote a couple blogs on the topic, way more than you're probably looking for, but I think you'll be able to create your own shell vars that do exactly what you want after reading the first or second blog on the topic.
http://nebula-rnd.com/blog/tech/mv/2008/03/d3shell1.html
HTH
T