How can I assign awk's variable to shell script's variable?
I have the following script, and I want to assign the output ($10 and $5) from awk to N and L:
output from gridinfo data.grd is: data.grd 50 100 41 82 -2796 6944 0.016 0.016 3001 2461. where N and L is suppose to be 3001 and 100. I use bash shell.
Hi Guys !
I am new to unix and want to find out how we can make sql statement data to shell script variable?
Any help/suggestion is greatly appreciated
-Chandra (1 Reply)
Dear Friends
I have text file as like below,
AAAAA|BHBHBH|VERYSMART
AAAAA| KKKKKK|GOOD
BBBBBB|JJJJJJJ|VERYGOOD
CCCCC|HJHJHJ|BETTER
CCCCC|UUUUU|GOOD
i need to split into seperate files based on column 1 like as below
AAAAA.TXT contains
--------------------
BHBHBH.VERYSMART... (4 Replies)
:confused: Hi UNIX gurus,
I am facing a typical problem while assigining while assigining output of awk to a variable.
I have a fixed length file say myinputfile.txt
When I allow the value/output of an awk to be redirected to a file, it works fine. i.e.
awk "/^.{232}$acctNum/ {... (8 Replies)
Hi Friends...
Please assist me to assign the result of a SQL query that results two column, to two variables.
Pls find the below code that I write for assigning one column to one variable. and please correct if anything wrong..
#! /bin/sh
no='
sqlplus -s uname/password@DBname... (4 Replies)
Dear All,
we have a command output which looks like :
Total 200 queues in 30000 Kbytes
and we're going to get "200" and "30000" for further process. currently, i'm using :
numA=echo $OUTPUT | awk '{print $2}'
numB=echo $OUTPUT | awk '{print $5}'
my question is : can I use just one... (4 Replies)
How can I assign a variable to an variable. IE $car=honda
One way I can do it is export $car=honda
or
let $car=2323
Is there any other ways to preform this task (3 Replies)
I have a log file that has certain fields that I want to evaluate, and depending on the value in those fields, I want to put the value of a different field in that line in a particular variable that I'll use later on down the log file. Sort of like setting a switch to change what I do with a bunch... (5 Replies)
I launch 'netstat -a', if string 'ESTABLISHED' found, then VAR=1
#!/bin/bash
VAR=0;
netstat -a | awk '$6 ~ /ESTABLISHED/ {VAR=1}'
I cannot find the right syntax.
thanx guys! (3 Replies)
Hi Gurus,
I have a script which assign awk output to shell variable. current it uses two awk command to assign value to two variables. I want to use one command to assign two values to two variables. I tried the code, but it does't work. kindly provide your suggestion.
current code... (2 Replies)
Discussion started by: green_k
2 Replies
LEARN ABOUT DEBIAN
grdsample
GRDSAMPLE(l) GRDSAMPLE(l)
NAME
grdsample - Resample a grd file onto a new grid
SYNOPSIS
grdsample in_grdfile -Gout_grdfile [ -F ] [ -Idx[m|c][/dy[m|c]] ] [ -Lflag ] [ -Nnx/ny ] [ -Q ] [ -Rwest/east/south/north[r] ] [ -T ] [ -V
]
DESCRIPTION
grdsample reads a grdfile and interpolates it to create a new grdfile with either: a different registration (-T); or, a new grid-spacing
(-I) or number of nodes (-N), and perhaps also a new sub-region (-R). Interpolation is bicubic [Default] or bilinear (-Q) and uses boundary
conditions (-L). Note that using (-R) only is equivalent to grdcut or grdedit -S. grdsample safely creates a fine mesh from a coarse one;
the converse may suffer aliasing unless the data are filtered using grdfft or grdfilter.
in_grdfile
The name of the input 2-D binary grd file.
-G The name of the output grd file.
OPTIONS
No space between the option flag and the associated arguments.
-F Force pixel registration. [Default is grid registration].
-I x_inc [and optionally y_inc] is the grid spacing. Append m to indicate minutes or c to indicate seconds.
-L Boundary condition flag may be x or y or xy indicating data is periodic in range of x or y or both set by -R, or flag may be g indi-
cating geographical conditions (x and y are lon and lat). [Default uses "natural" conditions (second partial derivative normal to
edge is zero).]
-N Specify number of columns nx and rows ny of new grid.
-Q Quick mode, use bilinear rather than bicubic interpolation.
-R west, east, south, and north specify the Region of interest. To specify boundaries in degrees and minutes [and seconds], use the
dd:mm[:ss] format. Append r if lower left and upper right map coordinates are given instead of wesn.
-T Translate between grid and pixel registration while keeping -R and -I the same; if input is grid-registered, output will be pixel-
registered and vice-versa. The input file determines -R, -I and -N so no other options are necessary (except possibly -L or -Q).
-V Selects verbose mode, which will send progress reports to stderr [Default runs "silently"].
HINTS
If an interpolation point is not on a node of the input grid, then a NaN at any node in the neighborhood surrounding the point will yield
an interpolated NaN. Bicubic interpolation [default] yields continuous first derivatives but requires a neighborhood of 4 nodes by 4 nodes.
Bilinear interpolation [-Q] uses only a 2 by 2 neighborhood, but yields only zeroth-order continuity. Use bicubic when smoothness is impor-
tant. Use bilinear to minimize the propagation of NaNs.
EXAMPLES
To resample the 5 x 5 minute grid in hawaii_5by5_topo.grd onto a 1 minute grid, try
grdsample hawaii_5by5_topo.grd -I1m -Ghawaii_1by1_topo.grd
To translate the gridline-registered file surface.grd to pixel registration, try
grdsample surface.grd -T -Gpixel.grd
SEE ALSO gmt(1gmt), grdedit(1gmt), grdfft(1gmt), grdfilter(1gmt)
1 Jan 2004 GRDSAMPLE(l)