01-18-2010
thanks everybody for ur suggestions ...
I learnt anew thing :-)
10 More Discussions You Might Find Interesting
1. Programming
i made a lot of processes. here is the code:
main()
{
printf("\nEnter K="); scanf("%d",&k);
printf("Enter L="); scanf("%d",&l);
printf("\nFather id=%d\n",getpid());
x=0;
makechild();
sleep(2);
return 1;
}
int makechild()
{
for(q=1;q<=k;q++)
{
if(f=fork())
{
... (5 Replies)
Discussion started by: bb666
5 Replies
2. UNIX for Dummies Questions & Answers
Hi,
Is it possible that the output of a command is piped into a unix function? Just like in below:
#!/bin/ksh
concat(){
echo Orbix
}
echo "Hello there" | concat
How to manipulate the output of a command inside the function? (2 Replies)
Discussion started by: Orbix
2 Replies
3. UNIX for Advanced & Expert Users
We encountered an issue in our project while using the Interix UNIX (SFU 3.5) and explained our query below. We would be happy if anybody helps us to troubleshoot the problem J
In our code the trapping signal for all signals like HUP, INT, QUIT, ILL, TRAP, ABRT, EXCEPT, etc., is initialized in... (4 Replies)
Discussion started by: RAMESHPRABUDASS
4 Replies
4. Shell Programming and Scripting
Hello,
Would this be an acceptable way of creating a non-blocking pipe.
Basically I want to create kind of a server client arch.
This code would be in the server, and I don't want to have to wait for
clients to read before moving on to the next client. One problem I
can see is if... (4 Replies)
Discussion started by: cdlaforc
4 Replies
5. Shell Programming and Scripting
I have the following command in a Bash shell script:
who | grep -w $1 | some other commands
If grep fails, an error message is displayed. How do I test if grep fails and still be able to pipe it's output to the rest of the commands?
I have the following solution:
a=`who | grep -w $1`... (3 Replies)
Discussion started by: oinkl
3 Replies
6. Programming
Hello guys,
my professor give me 2 days to study and make a program usign pipe, fork in c
i need to do a program
read a arq.txt
the father process read the file and the child print !
like this
#include <stdio.h>
#include <stdlib.h>
#include <sys/wait.h>
int main (){
... (1 Reply)
Discussion started by: beandj
1 Replies
7. Shell Programming and Scripting
Hi, guys:
I am working on my shell using c. How can I use pipe to implement the following?
ls -l 1>> | grep hellp 1<< 2>> | less 2<<
(the output of ls goes to grep, and the output of grep goes to less)
Thanks
Please use and tags when posting code, data or logs etc. to preserve... (1 Reply)
Discussion started by: tomlee
1 Replies
8. Shell Programming and Scripting
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
9. Shell Programming and Scripting
Hi guys,
I need to know how i can ignore Pipe '|' if Pipe is coming as a column in Pipe delimited file
for eg:
file 1:
xx|yy|"xyz|zzz"|zzz|12...
using below awk command
awk 'BEGIN {FS=OFS="|" } print $3
i would get xyz
But i want as :
xyz|zzz to consider as whole column... (13 Replies)
Discussion started by: rohit_shinez
13 Replies
10. Shell Programming and Scripting
Greetings. This is my first post in this forum; I hope y'all find it useful. One caveat: "Concise" is my middle name. NOT! :D
I am almost done with a shell script that runs as a daemon. It monitors a message log that is frequently written to by a database server but it it works my client will... (2 Replies)
Discussion started by: jakesalomon
2 Replies
LEARN ABOUT DEBIAN
explain_pipe_or_die
explain_pipe_or_die(3) Library Functions Manual explain_pipe_or_die(3)
NAME
explain_pipe_or_die - create pipe and report errors
SYNOPSIS
#include <libexplain/pipe.h>
void explain_pipe_or_die(int *pipefd);
DESCRIPTION
The explain_pipe_or_die function is used to call the pipe(2) system call. On failure an explanation will be printed to stderr, obtained
from explain_pipe(3), and then the process terminates by calling exit(EXIT_FAILURE).
This function is intended to be used in a fashion similar to the following example:
explain_pipe_or_die(pipefd);
pipefd The pipefd, exactly as to be passed to the pipe(2) system call.
Returns:
This function only returns on success. On failure, prints an explanation and exits.
SEE ALSO
pipe(2) create pipe
explain_pipe(3)
explain pipe(2) errors
exit(2) terminate the calling process
COPYRIGHT
libexplain version 0.52
Copyright (C) 2009 Peter Miller
explain_pipe_or_die(3)