10 More Discussions You Might Find Interesting
1. Programming
To begin with FYI, I really struggled with the question before asking to simplify as much as I can around 1 hour and to increase the code's readability I neglect error checks.
I intend to communicate parent and child using PIPE. In the following program I do traverse given path and its... (2 Replies)
Discussion started by: beginnerboy
2 Replies
2. Shell Programming and Scripting
Hello,
I am trying to stream lines written into file. When first source is down, I expect the code to swap to second line and run it.
Script below works as usual and it prints out each line of the input file (s.txt):
#!/bin/bash
while read -r line;
do
echo "$line"
done <"$1"
exit 0Output... (12 Replies)
Discussion started by: baris35
12 Replies
3. Shell Programming and Scripting
Hi,
I have a script that runs a tar command to standard out then pipes to a gzip:
tar cfE - * | gzip -c > OUT.gz
At the moment, even if the tar fails (e.g. because of lack of disk space), the gzip still runs successfully.
Is there a way to make the whole line exit with a non-zero error... (6 Replies)
Discussion started by: Catullus
6 Replies
4. Shell Programming and Scripting
Hi
I am quite new to scripting and cannot work out how to do the following -
I want to pipe to a log file and then use the "last statement error" in an if statement after, and this doesn't work because it checks the pipe statement instead of the script.
Example:
executteTheScript $var |... (4 Replies)
Discussion started by: erjorgito
4 Replies
5. UNIX for Dummies Questions & Answers
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
6. Shell Programming and Scripting
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
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
8. Programming
All,
I am using the below code
The C 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... (0 Replies)
Discussion started by: arunkumar_mca
0 Replies
9. Programming
Hi all...
I have the following code:
FILE *fp = popen(" gzip -dc /somemount/somefile.gz", "r");
while(fgets(buffer, 1024, fp))
{
some code....
}
"/somemount" is a mount of some network drive. Sometimes error occurs in while loop - I can see the following "Input/Output error"... (4 Replies)
Discussion started by: adm1n
4 Replies
10. AIX
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