Sunday, November 27, 2005

Ken Allen's parameter trick

Ken Allen wrote me about a neat trick he used for the marchives command (for searching heavy-metal archives). First trick is that ${-} allows you to use "--" to separate two parameters (which looks kinda neat), as follows:

marchives -t band -- funeral urn

Second trick is to use %s in case the user forgets or does not wish to use the -t or --, like so:

marchives funeral urn

Here's how he did it. Note the ${-} and the %s:

http://www.metal-archives.com/search.php?type=${t=band}&string=${-}%s

Thanks Ken!

0 Comments:

Post a Comment

<< Home