Sponsored Content
Full Discussion: Broken Pipe error
Top Forums Programming Broken Pipe error Post 302407134 by arunkumar_mca on Wednesday 24th of March 2010 03:59:00 PM
Old 03-24-2010
Broken Pipe error

All,

I am using the below code

The C code :



Code:
if ((fp2=fopen(szout_fname,"r"))==NULL)

            {

                        sprintf(stream_ptr1,"cat %s | sort -t,  -rn -k 11,11 | awk -F\",\" '{ \

        if ( \$3 ==\"%s\" ) {print \$1\",\"\$2\",\"\$4\",\"\$5\",\"\$6\",\"\$7\",\"\$10\",,,\"\$8\",\"\$9\",\"\$3} \

        }'  | head -%d > %s",szoutlr_fname,product,num_of_top_records,szout_fname);

            }

            else

            {

                        fclose(fp2);

                        sprintf(stream_ptr1,"cat %s | sort -t,  -rn -k 11,11 | awk -F\",\" '{ \

                        if ( \$3 ==\"%s\" ) { \

        print \$1\",\"\$2\",\"\$4\",\"\$5\",\"\$6\",\"\$7\",\"\$10\",,,\"\$8\",\"\$9\",\"\$3 \

    } \

    }'  | head -%d >> %s",szoutlr_fname,product,num_of_top_records,szout_fname);

           }


If i use the above code to and run the program i am getting the error as below , Broken Pipe error . see the below from the output file

Code:
Command to Sort: cat 1input_file | sort -t,  -rn -k 11,11 | awk -F"," '{           if ( $3 =="  73928711" ) {         print $1","$2","$4","$5","$6","$7","$10",,,"$8","$9","$3     }     }'  | head -100 >> /tmp21208391

Command to Sort: cat 1input_file | sort -t,  -rn -k 11,11 | awk -F"," '{           if ( $3 =="  73928712" ) {         print $1","$2","$4","$5","$6","$7","$10",,,"$8","$9","$3     }     }'  | head -100 >> /tmp21208391

Command to Sort: cat 1input_file | sort -t,  -rn -k 11,11 | awk -F"," '{           if ( $3 =="  73928713" ) {         print $1","$2","$4","$5","$6","$7","$10",,,"$8","$9","$3     }     }'  | head -100 >> /tmp21208391

awk: cmd. line:1: (FILENAME=- FNR=193) fatal: print to "standard output" failed (Broken pipe)

Command to Sort: cat 1input_file | sort -t,  -rn -k 11,11 | awk -F"," '{           if ( $3 =="  73928722" ) {         print $1","$2","$4","$5","$6","$7","$10",,,"$8","$9","$3     }     }'  | head -100 >> /tmp21208391

Please let me know why this is happening


Thanks,
Arun
 

10 More Discussions You Might Find Interesting

1. Linux

pipe broken

hi i have a server, and i have a web site and i installed apache in the /usr/local/apache/logs i have a file and i have this problem (32)Broken pipe: core_output_filter: writing data to the network plz help me how i can resolve this plz it's urgent th (2 Replies)
Discussion started by: abir2
2 Replies

2. AIX

broken pipe error

Hi, I am working on AIX 5.3 . I have client-server program which is in ProC.while sending packet to server i am getting error as broken pipe and program exiting. please help?/? (1 Reply)
Discussion started by: ajaysahoo
1 Replies

3. UNIX for Dummies Questions & Answers

echo: write error: Broken pipe ??

I want to try the unix pipe, the command is like this: echo new | find . the standard output of the echo should be "new", then I guess find command will use this output as input to find the file named "new". But the output is all the file names in my current dir, the last line is "echo: write... (5 Replies)
Discussion started by: andrewust
5 Replies

4. Shell Programming and Scripting

Replace pipe with Broken Pipe

Hi All , Is there any way to replace the pipe ( | ) with the broken pipe (0xA6) in unix (1 Reply)
Discussion started by: saj
1 Replies

5. UNIX for Advanced & Expert Users

sftp error:- Couldn't send packet: Broken pipe

Hi, I am trying to sftp a large file(appx. 2 GB size) from solaris 10 to a Linux server. While sftping(with no options), connection is terminated after some time with broken pipe error. sftp with option -R1 or -B1500 is successful. Linux server ssh Version: OpenSSH_3.9p1, OpenSSL 0.9.7a... (3 Replies)
Discussion started by: brij123
3 Replies

6. Shell Programming and Scripting

Broken Pipe error

Hello while doing sftp over server "A" , i am getting a broken pipe error i.e cat: write error: Broken pipe what does that mean? please let me know if you want any other info on this.. (3 Replies)
Discussion started by: urfrnddpk
3 Replies

7. UNIX for Dummies Questions & Answers

broken pipe error

I'm new to scripting, and this forum has been invaluable in helping me out. I'm hoping I can get some personal help now though. I have a korn script that takes a list of servers and either telnets or sshs into it (only some are set up for ssh). What I'm doing now is trying to telnet first, and... (10 Replies)
Discussion started by: aimeet
10 Replies

8. UNIX for Dummies Questions & Answers

SFTP error between UNIX to iSeries (Write Failed Broken Pipe)

Hi, I am iseries resource and having Issue in one of the sFTP failures between one of my job (Unix --> iSeries). The response to sending machine (Unix) is "Write Failed Broken Pipe". Appreciate any help Available on why this Issue happens, how can we replicate the same, what fixes can... (1 Reply)
Discussion started by: hamelchauhan
1 Replies

9. Solaris

RWSocket::send: Broken pipe Error in /var/adm/messages

Hi Guys, I am getting some strange error in /var/adm/messages in my Solaris 10 box with Veritas Cluster and EMC storage. bash-3.00$ cat /var/adm/messages | egrep -v "lw8|snmp|sshd|xntpd|kern.info|LOGIN|link|service|started|finished|repeated|SS7 Log-daemon|success" Dec 18 09:58:35 GAMMa2... (1 Reply)
Discussion started by: vivek.goel.piet
1 Replies

10. Shell Programming and Scripting

How can we overcome Broken pipe error during scp,SFTP,Rsync while transferring big files.?

Hello All, Hope all are doing well. We use scp (some times sftp and rsync also) for transferring big files (around 2GB each ) from 1 Network to another Network. The Issues which we face :- During transfer some times( Once in 1 week (or twice)) , the speed of transfer gets down to 30 kb/s,... (2 Replies)
Discussion started by: Upendra Bhushan
2 Replies
wsprintf(3C)						   Standard C Library Functions 					      wsprintf(3C)

NAME
wsprintf - formatted output conversion SYNOPSIS
#include <stdio.h> #include <widec.h> int wsprintf(wchar_t *s, const char *format, /* arg */ ... );); DESCRIPTION
The wsprintf() function outputs a Process Code string ending with a Process Code (wchar_t) null character. It is the user's responsibility to allocate enough space for this wchar_t string. This returns the number of Process Code characters (excluding the null terminator) that have been written. The conversion specifications and behavior of wsprintf() are the same as the regular sprintf(3C) function except that the result is a Process Code string for wsprintf(), and on Extended Unix Code (EUC) character string for sprintf(). RETURN VALUES
Upon successful completion, wsprintf() returns the number of characters printed. Otherwise, a negative value is returned. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------------------------------------+ |ATTRIBUTE TYPE ATTRIBUTE VALUE | |MT-Level MT-Safe | +-----------------------------------------------------------+ SEE ALSO
wsscanf(3C), printf(3C), scanf(3C), sprintf(3C), attributes(5) SunOS 5.11 29 Dec 1996 wsprintf(3C)
All times are GMT -4. The time now is 01:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy