[Antelope] shell variables and dbsubset

Jennifer Eakins jeakins at ucsd.edu
Sat Nov 29 00:32:19 CST 2008


Try this:

#!/bin/sh

STATION='P21A'
#dbsubset usarray.arrival 'sta == "$STATION" ' > out.view
#dbsubset usarray.arrival 'sta=="$STATION"' > out.view


dbsubset -v usarray.arrival " sta=='$STATION' " | dbunjoin -o p21a_tmp -

Use a double quote on the outside, single quote around $STATION.  I  
added spaces above for clarity (between " and stat and STATION' and ").

--Jennifer



On Nov 28, 2008, at 6:06 PM, Jonathan MacCarthy wrote:

> Hello, all.  I have a quick shell scripting question that I thought  
> would be easy to answer, but I haven't found anything yet.
> I'm simply trying to substitute a shell variable into a dbsubset  
> call.  Something like:
>
> #!/bin/sh
>
> STATION="P21A"
> dbsubset db.assoc 'sta == "$STATION" ' > out.view
>
>
>
> ...I've tried all sorts of escapes, but dbsubset will have none of  
> them.  Does anyone see what I'm doing wrong?
>
> Thank you in advance.
>
> Best,
> Jonathan
>
>
>
> Jonathan MacCarthy
> PhD Candidate in Seismology
> New Mexico Institute of Mining and Technology
> Dept. of Earth and Environmental Science, MSEC208
> 801 Leroy Place
> Socorro, NM 87801
> ph: 505.835.5418
> web: www.ees.nmt.edu/~jkmacc
>
> _______________________________________________
> Antelope mailing list
> Antelope at brtt.net
> http://brtt.net/mailman/listinfo/antelope_brtt.net

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://brtt.net/pipermail/antelope_brtt.net/attachments/20081128/d904315c/attachment-0001.html>


More information about the Antelope mailing list