Sponsored Content
Top Forums UNIX for Dummies Questions & Answers String manipulation for sheer speed... Post 302813225 by alister on Sunday 26th of May 2013 08:10:05 PM
Old 05-26-2013
bash has a well-deserved reputation for being slow. A few years ago, its poor performance led Ubuntu Linux to abandon it for boot scripts (although bash remains the default interactive login shell for users).

If you aren't wedded to bash, and if the scripts in question aren't brimming with bashisms, you could try running them under ksh (which was installed by default on OS X when I last used the OS, a few years ago).

Regards,
Alister
This User Gave Thanks to alister For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

string manipulation

Hello, I have a korn shell string variable str1 = "A,B,Z" I would like to create another korn shell string variable str2 = "letter = 'A' or letter = 'B' or letter = 'Z' " Please help! Thanks in advance an UNIX newbie! (13 Replies)
Discussion started by: hai1973
13 Replies

2. Shell Programming and Scripting

String Manipulation Help

Hey Guys, Right i know how to alter a word to begin with a capital letter, i know how to remove unwanted characters and replace them with the relevant character however i don't now if there is a way to do them all in one line. Code: echo -n ${string:0:1} | tr a-z A-Z #convert first letter... (4 Replies)
Discussion started by: shadow0001
4 Replies

3. Shell Programming and Scripting

string manipulation

i have a file that contains a pattern like this: ajay 1234 newyork available kumar 2345 denver singh 2345 newyork ajay 3456 denver kumar 3456 newyork singh 3456 delhi available ajay 4567 miami kumar 4567 miami singh 4567 delhi i want to search for each line... (5 Replies)
Discussion started by: ajay41aj
5 Replies

4. Shell Programming and Scripting

string manipulation

if I have two string variable, how do I add one to anther. like a= "a" b="b" c=$a+$b but that doesn't work. Is there anyway to solve it.http://www.qtl.co.il/img/copy.pnghttp://www.google.com/favicon.icohttp://www.babylon.com/favicon.icohttp://www.morfix.com/favicon.ico (2 Replies)
Discussion started by: programAngel
2 Replies

5. Shell Programming and Scripting

Help With String Manipulation

Hi Guru's, I need some help with data manipulation using shell scripting. I know how to replace the whole string but not part of the string. The value after aa= should be replaced with the value in the mail leaving ,OU=111,OU=222,DC=333 as is. Below are the inputs and expected outputs. Input:... (17 Replies)
Discussion started by: Samingla
17 Replies

6. Shell Programming and Scripting

string manipulation

Hi, I have the followoing details in one file: opt/tra/domain/test/new/filename1 training/ear/help I need to manipulate the string in the following manner: filename1= opt/tra/domain/test/new/filename1 help=training/ear/help last string is the name and equal sign and then... (2 Replies)
Discussion started by: ckchelladurai
2 Replies

7. Shell Programming and Scripting

Deleting part of a string : string manipulation

i have something like this... echo "teCertificateId" | awk -F'Id' '{ print $1 }' | awk -F'te' '{ print $2 }' Certifica the awk should remove 'te' only if it is present at the start of the string.. anywhere else it should ignore it. expected output is Certificate (7 Replies)
Discussion started by: vivek d r
7 Replies

8. Shell Programming and Scripting

String manipulation

Hi , I am getting a string like aaa,bbb,sdsdad,sdfsdf,sdfsdfdsf,rtyrtyr,45654654,ddfdfdfgdfg,dfgdfgdg........... Now what I need is to format it. So after each nth comma I need one newline. So the above will look like when n=3 aaa,bbb,sdsdad, sdfsdf,sdfsdfdsf,rtyrtyr,... (4 Replies)
Discussion started by: Anupam_Halder
4 Replies

9. Shell Programming and Scripting

String Manipulation

I'm making a little game in Perl, and I am trying to remove the first instance of a character in an arbitrary string. For example, if the string is "cupcakes"and the user enters another string that contains letters from "cupcake" e.g: "sake"the original string will now look like this (below)... (3 Replies)
Discussion started by: whyte_rhyno
3 Replies

10. OS X (Apple)

String manipulation

i have a string that am looking to extract all characters following 3 consecutiv numbers. Example my string is J1705PEAN038TDMN, i need to get TDMN My string can have multiple 3 consecutive numbers, i need what follows last occurance (9 Replies)
Discussion started by: gigagigosu
9 Replies
GRD2XYZ(l)																GRD2XYZ(l)

NAME
grd2xyz - Converting a grdfile to an ASCII or binary table SYNOPSIS
grd2xyz grdfile [ -H[nrec] ] [ -L ] [ -Rwest/east/south/north[r] [ -S[r ] [ -V ] [ -Z[flags] ] [ -bo[s][n] ] DESCRIPTION
grd2xyz reads a binary 2-D grdfile and writes out xyz-triplets in ASCII [or binary] format to standard output. Modify the precision of the ASCII output format by editing the D_FORMAT parameter in your .gmtdefaults file, or choose binary output using single or double precision storage. As an option you may output z-values without the (x,y) in a number of formats, see -Z below. grdfile The 2-D binary file to be converted. OPTIONS
-H Output 1 header record based on information in the grdfile header. Ignored if binary output is selected. [Default is no header]. -L Indicates that the x values are longitudes (necessary for -: to work). -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. -S Suppress output for nodes whose z-value equals NaN [Default outputs all nodes]. Append r to reverse the suppression, i.e., only output the nodes whose z-value equals NaN. -V Selects verbose mode, which will send progress reports to stderr [Default runs "silently"]. -Z Write a 1-column ASCII [or binary] table. Output will be organized according to the specified ordering convention contained in flags. If data should be written by rows, make flags start with T(op) if first row is y = ymax or B(ottom) if first row is y = ymin. Then, append L or R to indicate that first element should start at left or right end of row. Likewise for column formats: start with L or R to position first column, and then append T or B to position first element in a row. For gridline registered grids: If grid is periodic in x but the outcoming data should not contain the (redundant) column at x = xmax, append x. For grid periodic in y, skip writing the redundant row at y = ymax by appending y. If the byte-order needs to be swapped, append w. Select one of several data types (all binary except a): a ASCII representation c signed 1-byte character u unsigned 1-byte character h short 2-byte integer i 4-byte integer l long (4- or 8-byte) integer f 4-byte floating point single precision d 8-byte floating point double precision Default format is scanline orientation of ASCII numbers: -ZTLa. Note that -Z only applies to 1-column output. -bo Selects binary output. Append s for single precision [Default is double]. This option only applies to xyz output; see -Z for z ta- ble output. EXAMPLES
To edit individual values in the 5' by 5' hawaii_grv.grd file, try grd2xyz hawaii_grv.grd > hawaii_grv.xyz To write a single precision binary file without the x,y positions from the file raw_data.grd file, using scanline orientation, try grd2xyz raw_data.grd -ZTLf > hawaii_grv.b SEE ALSO
gmtdefaults(1gmt), gmt(1gmt), grdedit(1gmt), xyz2grd(1gmt) 1 Jan 2004 GRD2XYZ(l)
All times are GMT -4. The time now is 11:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy