<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Cool. It's nice that you can even DO that. However, the script is
UNREADABLE, and most importantly, the differences are buried .<br>
<br>
Try breaking the URL up into pieces, as follows:<br>
<br>
<tt>host=<a class="moz-txt-link-freetext" href="http://polaris.hclibrary.org">http://polaris.hclibrary.org</a><br>
path=polaris/search/searchresults.aspx<br>
arg1="ctx=1.1033.0.0.6&amp;type=Advanced&amp;term=$SEARCH_TERM&amp;term2=&amp;term3=&amp;term4="<br>
arg2="by2=KW&amp;by3=KW&amp;by4=KW&amp;bool1=And&amp;bool2=And&amp;bool3=And<br>
arg4="limit=TOM=*&amp;sort=RELEVANCE&amp;page=0"<br>
<br>
case $OPTION in<br>
(-a)&nbsp;&nbsp;&nbsp; arg3="by=AU";;<br>
(-i)&nbsp;&nbsp;&nbsp; arg3="by=ISBN";;<br>
(-t)&nbsp;&nbsp;&nbsp; arg3="by=TI";;<br>
(*)&nbsp;&nbsp;&nbsp; usage;;<br>
esac</tt><br>
<br>
exec firefox --new-tab "$host/$path?$arg1&amp;$arg2&amp;$arg3&amp;$arg4"<br>
<br>
Now, if you wanted to add a -d (for date: by=DA) option, well, it's so
simple, Even a Caveman Could Do It.<br>
<br>
Please not that any source code, in any language should not exceed 80
characters in width if possible.<br>
<br>
JIM<br>
<br>
On 7/6/2010 3:30 PM, John L. Cunningham wrote:
<blockquote cite="mid:20100706193029.GB4552@infotech" type="cite">
  <pre wrap="">The redesigned Howard County Public Library site is too pointy-clicky
for my taste.  Therefore, I have written a rudementary bash script that
allows me to search the catalog from the command line.


--- BEGIN hcllookup.sh ---
#!/bin/bash

OPTION="$1"
shift
SEARCH_TERM="$*"

case "$OPTION" in
        -a)
        firefox --new-tab <a class="moz-txt-link-rfc2396E" href="http://polaris.hclibrary.org/polaris/search/searchresults.aspx?ctx=1.1033.0.0.6&amp;type=Advanced&amp;term=$SEARCH_TERM&amp;term2=&amp;term3=&amp;term4=&amp;by=AU&amp;by2=KW&amp;by3=KW&amp;by4=KW&amp;bool1=And&amp;bool2=And&amp;bool3=And&amp;limit=TOM=*&amp;sort=RELEVANCE&amp;page=0">"http://polaris.hclibrary.org/polaris/search/searchresults.aspx?ctx=1.1033.0.0.6&amp;type=Advanced&amp;term=$SEARCH_TERM&amp;term2=&amp;term3=&amp;term4=&amp;by=AU&amp;by2=KW&amp;by3=KW&amp;by4=KW&amp;bool1=And&amp;bool2=And&amp;bool3=And&amp;limit=TOM=*&amp;sort=RELEVANCE&amp;page=0"</a>
        ;
        -i)
        firefox --new-tab <a class="moz-txt-link-rfc2396E" href="http://polaris.hclibrary.org/polaris/search/searchresults.aspx?ctx=1.1033.0.0.6&amp;type=Advanced&amp;term=$SEARCH_TERM&amp;term2=&amp;term3=&amp;term4=&amp;by=ISBN&amp;by2=KW&amp;by3=KW&amp;by4=KW&amp;bool1=And&amp;bool2=And&amp;bool3=And&amp;limit=TOM=*&amp;sort=RELEVANCE&amp;page=0">"http://polaris.hclibrary.org/polaris/search/searchresults.aspx?ctx=1.1033.0.0.6&amp;type=Advanced&amp;term=$SEARCH_TERM&amp;term2=&amp;term3=&amp;term4=&amp;by=ISBN&amp;by2=KW&amp;by3=KW&amp;by4=KW&amp;bool1=And&amp;bool2=And&amp;bool3=And&amp;limit=TOM=*&amp;sort=RELEVANCE&amp;page=0"</a>
        ;
        -t)
        firefox --new-tab <a class="moz-txt-link-rfc2396E" href="http://polaris.hclibrary.org/polaris/search/searchresults.aspx?ctx=1.1033.0.0.6&amp;type=Advanced&amp;term=$SEARCH_TERM&amp;term2=&amp;term3=&amp;term4=&amp;by=TI&amp;by2=KW&amp;by3=KW&amp;by4=KW&amp;bool1=And&amp;bool2=And&amp;bool3=And&amp;limit=TOM=*&amp;sort=RELEVANCE&amp;page=0">"http://polaris.hclibrary.org/polaris/search/searchresults.aspx?ctx=1.1033.0.0.6&amp;type=Advanced&amp;term=$SEARCH_TERM&amp;term2=&amp;term3=&amp;term4=&amp;by=TI&amp;by2=KW&amp;by3=KW&amp;by4=KW&amp;bool1=And&amp;bool2=And&amp;bool3=And&amp;limit=TOM=*&amp;sort=RELEVANCE&amp;page=0"</a>
        ;
        *)
        printf "Usage: hcllookup [OPTION] [SEARCH TERM(S)...]\n\t-a, Author\n\t-i, ISBN\n\t-t, Title\n"
        ;
esac
--- END hcllookup.sh ---


John

_______________________________________________
CALUG mailing list
<a class="moz-txt-link-abbreviated" href="mailto:CALUG@unknownlamer.org">CALUG@unknownlamer.org</a>
<a class="moz-txt-link-freetext" href="http://lists.unknownlamer.org/listinfo/calug">http://lists.unknownlamer.org/listinfo/calug</a></pre>
  <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>

No virus found in this incoming message.
Checked by AVG - <a class="moz-txt-link-abbreviated" href="http://www.avg.com">www.avg.com</a> 
Version: 9.0.830 / Virus Database: 271.1.1/2985 - Release Date: 07/06/10 02:36:00

  </pre>
</blockquote>
<br>
</body>
</html>