From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 45334 invoked by alias); 23 Nov 2015 14:00:54 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 45313 invoked by uid 89); 23 Nov 2015 14:00:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.0 required=5.0 tests=AWL,BAYES_50,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-lb0-f171.google.com Received: from mail-lb0-f171.google.com (HELO mail-lb0-f171.google.com) (209.85.217.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 23 Nov 2015 14:00:52 +0000 Received: by lbbsy6 with SMTP id sy6so95890235lbb.2 for ; Mon, 23 Nov 2015 06:00:49 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.112.198.106 with SMTP id jb10mr10957326lbc.111.1448287249268; Mon, 23 Nov 2015 06:00:49 -0800 (PST) Received: by 10.25.80.202 with HTTP; Mon, 23 Nov 2015 06:00:49 -0800 (PST) In-Reply-To: References: Date: Mon, 23 Nov 2015 14:00:00 -0000 Message-ID: Subject: Re: Awk not ouputting results via echo From: Lester Anderson To: cygwin@cygwin.com Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg00350.txt.bz2 The error when run is: ERROR 4: `///' does not exist in the file system, and is not recognised as a supported dataset name. img2grd (GMTAPI_Import_Grid): Not a supported grid format [///] Error returned from GMT API: GMT_GRID_READ_ERROR (18) img2grd: Syntax error -R option. Correct syntax: -R///[//] Append r if giving lower left and upper right coordinates -Rg or -Rd for global domain -R to take the domain from a grid file Error returned from GMT API: GMT_PARSE_ERROR (61) ERROR 4: `///' does not exist in the file system, and is not recognised as a supported dataset name. img2grd (GMTAPI_Import_Grid): Not a supported grid format [///] Error returned from GMT API: GMT_GRID_READ_ERROR (18) img2grd: Syntax error -R option. Correct syntax: -R///[//] Append r if giving lower left and upper right coordinates -Rg or -Rd for global domain -R to take the domain from a grid file Error returned from GMT API: GMT_PARSE_ERROR (61) Basically the variables lon_e_min, lon_e_max, lat_e_min and lat_e_max are not transferred as inputs to -R. I don't get any errors from the awk part. Lester On 23 November 2015 at 13:17, Lester Anderson wrote: > Hello, > > Having sorted how to access a separate drive location, I have expanded > the script to include an awk section which processes new coordinate > limits which should pass to img2grd to extract the data grids. > However, the awk scripting does not seem to generate any data - is > there something I am missing? Modified from a published script > > #!/bin/bash > ruta_elev="Q:/geophys/Potential-field datasets/Topography/topo_17.1.img" > ruta_grav="Q:/geophys/Potential-field datasets/Gravity/grav.img.23.1" > lon_min=-12 > lon_max=0 > lat_min=28 > lat_max=39 > R_d=167 > R_i=20 > > echo $lon_min $lon_max $lat_min $lat_max $R_d $R_i | > awk "{R_t=6370; > pi=3.14159; > lat_av=(($lat_max+$lat_min)/2)*(pi/180.); > lon_av=(($lon_min+$lon_max)/2); > d_lat_e=($R_d/R_t)*180./pi; > d_lon_e=($R_d/(R_t*cos(lat_av)))*180./pi; > d_lat_i=($R_i/R_t)*180./pi; > d_lon_i=($R_i/(R_t*cos(lat_av)))*180./pi; > lon_e_min=$lon_min-d_lon_e; > lon_e_max=$lon_max+d_lon_e; > lat_e_min=$lat_min-d_lat_e; > lat_e_max=$lat_max+d_lat_e; > lon_i_min=$lon_min-d_lon_i; > lon_i_max=$lon_max+d_lon_i; > lat_i_min=$lat_min-d_lat_i; > lat_i_max=$lat_max+d_lat_i; > print lon_e_min,lon_e_max,lat_e_min,lat_e_max,lon_i_min,lon_i_max,lat_i_min,lat_i_max,lat_av*180./pi,lon_av; > }" | read lon_e_min lon_e_max lat_e_min lat_e_max lon_i_min lon_i_max > lat_i_min lat_i_max lat_av lon_av > proj='m'$lon_av'/'$lat_av'/16' > echo $lon_e_min $lon_e_max $lat_e_min $lat_e_max $lon_i_min $lon_i_max > $lat_i_min $lat_i_max $lat_av $lon_av > # > img2grd "$ruta_elev" -V -T1 > -R$lon_e_min/$lon_e_max/$lat_e_min/$lat_e_max -S1 -Gelev.grd -I1m -D > img2grd "$ruta_grav" -T1 -V > -R$lon_e_min/$lon_e_max/$lat_e_min/$lat_e_max -S0.1 -GFA.grd -I1m -D > # > > Any pointers on this, thanks > > Lester -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple