<!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&type=Advanced&term=$SEARCH_TERM&term2=&term3=&term4="<br>
arg2="by2=KW&by3=KW&by4=KW&bool1=And&bool2=And&bool3=And<br>
arg4="limit=TOM=*&sort=RELEVANCE&page=0"<br>
<br>
case $OPTION in<br>
(-a) arg3="by=AU";;<br>
(-i) arg3="by=ISBN";;<br>
(-t) arg3="by=TI";;<br>
(*) usage;;<br>
esac</tt><br>
<br>
exec firefox --new-tab "$host/$path?$arg1&$arg2&$arg3&$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&type=Advanced&term=$SEARCH_TERM&term2=&term3=&term4=&by=AU&by2=KW&by3=KW&by4=KW&bool1=And&bool2=And&bool3=And&limit=TOM=*&sort=RELEVANCE&page=0">"http://polaris.hclibrary.org/polaris/search/searchresults.aspx?ctx=1.1033.0.0.6&type=Advanced&term=$SEARCH_TERM&term2=&term3=&term4=&by=AU&by2=KW&by3=KW&by4=KW&bool1=And&bool2=And&bool3=And&limit=TOM=*&sort=RELEVANCE&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&type=Advanced&term=$SEARCH_TERM&term2=&term3=&term4=&by=ISBN&by2=KW&by3=KW&by4=KW&bool1=And&bool2=And&bool3=And&limit=TOM=*&sort=RELEVANCE&page=0">"http://polaris.hclibrary.org/polaris/search/searchresults.aspx?ctx=1.1033.0.0.6&type=Advanced&term=$SEARCH_TERM&term2=&term3=&term4=&by=ISBN&by2=KW&by3=KW&by4=KW&bool1=And&bool2=And&bool3=And&limit=TOM=*&sort=RELEVANCE&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&type=Advanced&term=$SEARCH_TERM&term2=&term3=&term4=&by=TI&by2=KW&by3=KW&by4=KW&bool1=And&bool2=And&bool3=And&limit=TOM=*&sort=RELEVANCE&page=0">"http://polaris.hclibrary.org/polaris/search/searchresults.aspx?ctx=1.1033.0.0.6&type=Advanced&term=$SEARCH_TERM&term2=&term3=&term4=&by=TI&by2=KW&by3=KW&by4=KW&bool1=And&bool2=And&bool3=And&limit=TOM=*&sort=RELEVANCE&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>