Sponsored Content
Full Discussion: Tuning function
Top Forums Shell Programming and Scripting Tuning function Post 302423242 by varunrbs on Thursday 20th of May 2010 12:16:49 PM
Old 05-20-2010
tuning in final function

This is my final function. For 2000 records running in 3 minutes. Can this be tuned . Many Thanks in advance.

Code:
modify_customer_feed()
{
while IFS='' read line
do
f1="$(echo "$line" | cut -c1-18)"
f2="$(echo "$line" | cut -c19-27)"
f2=$(echo "$f2"|sed 's/ /0/g')
f2=$(echo "$f2"|sed 's/000000000/         /g')
f3="$(echo "$line" | cut -c28-686)"
f4="$(echo "$line" | cut -c687-702)"
f4=$(echo "$f4"|sed 's/ /0/g')
f4=$(echo "$f4"|sed 's/0000000000000000/                /g')

f5="$(echo "$line" | cut -c703-718)"
f5=$(echo "$f5"|sed 's/ /0/g')
f5=$(echo "$f5"|sed 's/0000000000000000/                /g')
f6="$(echo "$line" | cut -c719-854)"
printf "%s%s%s%s%s%s\n" "$f1" "$f2" "$f3" "$f4" "$f5" "$f6"
done < ${SOURCEFILE}    >  $id_final_file

if [[ $? -ne 0 ]]
then
  rm -f  $id_final_file
  return 1
else
  mv -f $id_final_file $SOURCEFILE
  return 0
fi
}

 

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
echo(1B)					     SunOS/BSD Compatibility Package Commands						  echo(1B)

NAME
echo - echo arguments to standard output SYNOPSIS
/usr/ucb/echo [-n] [argument] DESCRIPTION
echo writes its arguments, separated by BLANKs and terminated by a NEWLINE, to the standard output. echo is useful for producing diagnostics in command files and for sending known data into a pipe, and for displaying the contents of envi- ronment variables. For example, you can use echo to determine how many subdirectories below the root directory (/) is your current directory, as follows: o echo your current-working-directory's full pathname o pipe the output through tr to translate the path's embedded slash-characters into space-characters o pipe that output through wc -w for a count of the names in your path. example% /usr/bin/echo "echo $PWD | tr '/' ' ' | wc -w" See tr(1) and wc(1) for their functionality. The shells csh(1), ksh(1), and sh(1), each have an echo built-in command, which, by default, will have precedence, and will be invoked if the user calls echo without a full pathname. /usr/ucb/echo and csh's echo() have an -n option, but do not understand back-slashed escape characters. sh's echo(), ksh's echo(), and /usr/bin/echo, on the other hand, understand the black-slashed escape characters, and ksh's echo() also understands a as the audible bell character; however, these commands do not have an -n option. OPTIONS
-n Do not add the NEWLINE to the output. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWscpu | +-----------------------------+-----------------------------+ SEE ALSO
csh(1), echo(1), ksh(1), sh(1), tr(1), wc(1), attributes(5) NOTES
The -n option is a transition aid for BSD applications, and may not be supported in future releases. SunOS 5.10 3 Aug 1994 echo(1B)
All times are GMT -4. The time now is 02:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy