Sponsored Content
Full Discussion: Tuning function
Top Forums Shell Programming and Scripting Tuning function Post 302423254 by clx on Thursday 20th of May 2010 12:52:28 PM
Old 05-20-2010
you are having lots of redirection and command substitution on each line which makes this bulky.

If you can try the awk solution, that would be faster.

with some correction and removed typos,

Code:
awk '{
b=substr($0,1,18)
s=substr($0,19,9)
e=substr($0,28,length($0)-27)
gsub (" ","0",s)
if (s ~ /000000000/) {gsub ("0"," ",s);print b s e} else {print $0}}' file

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Performance tuning.

can someone tell me a good site to go to in order to learn this. please do not recommen nay books because i dont have interest in that. if you know of any good sites with good straight forward explanation on how to split loads on machines that has excessive loading, please let me know Also,... (1 Reply)
Discussion started by: TRUEST
1 Replies

2. UNIX for Advanced & Expert Users

Tuning Apache

I have an Apache 1.3.27 on a Solaris 8 Sun box that I am trying to tweek out for max performance. The only documentation I have run accross is on apache.org. I also have the O'Reilly Apache book. Anyone have another source I can refer to? (2 Replies)
Discussion started by: edkung
2 Replies

3. UNIX for Dummies Questions & Answers

Performance Tuning

Hi to all, I'm interested in finding an introduction about Performance Tuning under Unix (or Linux); can somebody please point me in the right direction? Best regards (1 Reply)
Discussion started by: domyalex
1 Replies

4. UNIX for Advanced & Expert Users

SAS Tuning

Does anyone had perfomed a tuning with SAS on Solaris??? Performance is not so good and I found out that Share Memory an Semaphores are the same that initial instalation, I havent found info at internet Please help (1 Reply)
Discussion started by: alex blanco
1 Replies

5. UNIX for Advanced & Expert Users

Tuning AIX IO

Hi I am trying to investigate a disk performance issue, and we are not seem to be hitting the right direction in our analysis. This is a FC disk running on USP1000 HDS system. The application is an IO intensive application, but our opinion is that it is not performing due to perceived disk... (1 Reply)
Discussion started by: theerthan
1 Replies

6. Solaris

tuning

hw to increse nfs perfomence tuning? (4 Replies)
Discussion started by: naresh.sun
4 Replies

7. Shell Programming and Scripting

Performance Tuning

Hi All, In last one week, i have posted many questions in this portal. At last i am succeeded to make my 1st unix script. following are 2 points where my script is taking tooooo long. 1. Print the total number of records excluding header & footer. I have found that awk 'END{print NR -... (2 Replies)
Discussion started by: Amit.Sagpariya
2 Replies

8. Web Development

MySQL Tuning Tools with mysqltuner.pl and tuning-primer.sh

We have been tuning MySQL lately and I ran accoss two useful tools that you might be interested in: mysqltuner.pl tuning-primer.sh Both of these scripts are quite useful for MySQL tuning. Here is some sample output of mysqltuner.pl >> MySQLTuner 0.9.8 - Major Hayden... (3 Replies)
Discussion started by: Neo
3 Replies

9. AIX

I/O tuning for oracle

is it a good practice to enable AIO (Async I/O) and mount the oracle file system with DIO with JFS2 (Direct I/O) option? please help (3 Replies)
Discussion started by: pchangba
3 Replies

10. Solaris

nxge tuning

Hi all, I would like to tune the nxge card as suggested by this link, but got some confusion. Can anyone advise me ? We have SunOS hsbc02 5.10 Generic_137137-09 sun4v sparc SUNW,Netra-CP3260 Do I have to install any patches ? The tunning link Networks - Siwiki In our nxge.conf, I... (0 Replies)
Discussion started by: dehetoxic
0 Replies
tapset::string(3stap)													     tapset::string(3stap)

NAME
tapset::string - systemtap string tapset DESCRIPTION
strlen Returns the length of a string See function::strlen(3stap) for details. substr Returns a substring See function::substr(3stap) for details. stringat Returns the char at a given position in the string See function::stringat(3stap) for details. isinstr Returns whether a string is a substring of another string See function::isinstr(3stap) for details. text_str Escape any non-printable chars in a string See function::text_str(3stap) for details. text_strn Escape any non-printable chars in a string See function::text_strn(3stap) for details. - strtol Convert a string to a long See function::-strtol(3stap) for details. isdigit Checks for a digit See function::isdigit(3stap) for details. SEE ALSO
function::strlen(3stap), function::substr(3stap), function::stringat(3stap), function::isinstr(3stap), function::text_str(3stap), function::text_strn(3stap), function::-(3stap), function::strtol(3stap), function::isdigit(3stap), stap(1), stapprobes(3stap) IBM
--- tapset::string(3stap)
All times are GMT -4. The time now is 10:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy