<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div>Hello Jonathan, <div><br></div><div>Try reversing the usage of single and double quotes. I believe the single quotes surrounding your subsetting expression are preventing variable interpolation by the shell:</div><div><br></div><div><div>% ./ascript </div><div> 4854 645 P21A P 9.99 2.566 241.82 59.79 -0.320 d -999.0 - -999.00 - -999.0 -1.000 kyrghyz -1 1227921744.85690</div><div>% </div><div><br></div><div>% cat ascript </div><div>#!/bin/sh</div><div><br></div><div>STATION="P21A"</div><div>dbsubset db.assoc "sta == '$STATION' " | dbselect - </div><div>% </div><div><br></div><div>Best regards,</div><div>Kent</div><div><br></div><div><br></div><div><br></div><div><div>On Nov 29, 2008, at 12:06 PM, Jonathan MacCarthy wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hello, all. I have a quick shell scripting question that I thought would be easy to answer, but I haven't found anything yet.<div>I'm simply trying to substitute a shell variable into a dbsubset call. Something like:</div><div><br></div><div>#!/bin/sh</div><div><br></div><div>STATION="P21A"</div><div>dbsubset db.assoc 'sta == "$STATION" ' > out.view</div><div><br></div><div><br></div><div><br></div><div>...I've tried all sorts of escapes, but dbsubset will have none of them. Does anyone see what I'm doing wrong?</div><div><br></div><div>Thank you in advance.</div><div><br></div><div>Best,</div><div>Jonathan</div><div><br></div><br><br><div apple-content-edited="true"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="font-family: Courier; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 11px/normal Helvetica; "><i>Jonathan MacCarthy</i></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="font-size: 11px; "><i>PhD Candidate in Seismology</i></span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="font-size: 11px; "><i>New Mexico Institute of Mining and Technology</i></span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 11px/normal Helvetica; "><i>Dept. of Earth and Environmental Science, MSEC208</i></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 11px/normal Helvetica; "><i>801 Leroy Place</i></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 11px/normal Helvetica; "><i>Socorro, NM 87801</i></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 11px/normal Helvetica; "><i>ph: 505.835.5418</i></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="font-size: 11px; "><i>web: <a href="http://www.ees.nmt.edu/~jkmacc">www.ees.nmt.edu/~jkmacc</a></i></span></font></div><div><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="font-size: 11px;"><i><br></i></span></font></div></div></span></div></div></div></div></div>_______________________________________________<br>Antelope mailing list<br><a href="mailto:Antelope@brtt.net">Antelope@brtt.net</a><br>http://brtt.net/mailman/listinfo/antelope_brtt.net<br></blockquote></div><br><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>--</div><div>Dr. Kent Lindquist <a href="mailto:kent@lindquistconsulting.com">kent@lindquistconsulting.com</a></div><div>Lindquist Consulting, Inc.</div><div>59 College Rd. Suite #7</div><div>Fairbanks, AK 99701 Phone/FAX 907-457-2374</div><div><br class="webkit-block-placeholder"></div><div><a href="http://www.lindquistconsulting.com">http://www.lindquistconsulting.com</a></div></div></span> </div><br></div></body></html>