Tuesday, December 16, 2008

Using caret '^' in Windows batch files

The caret '^' character serves two purposes in Windows batch files:

1. line continuations:
~~~
@echo off

dir ^
/ad ^
c:\temp
~~~~
results in dir /ad c:\temp, which lists only the directories in C:\temp. (Thanks to SteveGTR for that example.)

2. Escaping reserved shell characters & | ( < > ^. Use a preceding caret to escape and print the character:



echo this pipe will print ^| but this one won't |
echo and this will print one caret ^^

Tuesday, December 2, 2008

Monotype font for Wordpress "Write Post" text area

I like to use a monotype font (e.g. Courier) when I edit my blog posts in HTML mode. Wordpress seems to default to a proportional font. Try as I might, I couldn't find an easy way to change this from the WP admin pages, so I resorted to hacking the responsible stylesheet, /wp-admin/wp-admin.css, adding the font-family declaration for the #content text area:


editorcontainer #content {
font-family: Courier New, Courier, sans-serif;
padding: 0;
line-height: 150%;
border: 0 none;
outline: none;
}