Issue with output redirection | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Issue with output redirection

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 07-16-2012
pmonika pmonika is offline
Registered User
 
Join Date: Jul 2012
Last Activity: 19 July 2012, 6:47 AM EDT
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Issue with output redirection

Hi,

I am using AIX server. I have a korn shell script where in I am redirecting a line to a file in a while loop:



Code:
while read line
do
     outputline=$line;
     echo $outputline >> "./temp/exec_list_"$ETL_JOB_RUN"_temp"
done < ./temp/exec_list_$ETL_JOB_RUN

Sometimes, when the CPU usage goes upto 99%, the command "echo $outputline >> "./temp/exec_list_"$ETL_JOB_RUN"_temp"" does not work and skips to the next step. I think, the writer process is slower than the reader process or we'll have to increase the pipe size.

Any suggestions how this can be achieved?


Moderator's Comments:
Please use code tags next time for your code and data.

Last edited by zaxxon; 07-16-2012 at 09:30 AM.. Reason: code tags, see PM
Sponsored Links
    #2  
Old 07-19-2012
TRB TRB is offline
Registered User
 
Join Date: Apr 2010
Last Activity: 19 July 2012, 11:58 AM EDT
Posts: 24
Thanks: 0
Thanked 2 Times in 2 Posts
Is it possible that your "input" file contains metacharacters, which is being interpreted in you "echo" command...???
Sponsored Links
    #3  
Old 07-26-2012
Citroen Citroen is offline
Registered User
 
Join Date: Jul 2012
Last Activity: 13 March 2013, 9:10 AM EDT
Posts: 16
Thanks: 0
Thanked 1 Time in 1 Post

Code:
while read line
do
    print -- "$line" >> ./temp/exec_list_${ETL_JOB_RUN}_temp
done < ./temp/exec_list_${ETL_JOB_RUN}

Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Output redirection mfruiz34 UNIX for Dummies Questions & Answers 1 02-06-2011 12:56 PM
Output redirection jolateh Shell Programming and Scripting 5 01-20-2011 03:40 AM
Redirection output kma07 Shell Programming and Scripting 6 05-12-2010 07:14 PM
redirection and output nck Shell Programming and Scripting 2 10-23-2009 01:01 PM
tee vs output redirection confusion c_d UNIX for Dummies Questions & Answers 11 04-02-2009 05:44 AM



All times are GMT -4. The time now is 07:51 AM.