9 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
The task I have to do is something along the lines "I receive some input and based on the first character I send it through pipe to one of the children to print".
The scheme it is based on is 1->2; 1->3; 1->4; 2 will print all the input that starts with a letter, 3 will print all the input that... (2 Replies)
Discussion started by: Ildiko
2 Replies
2. Shell Programming and Scripting
Hi, I want to display the process tree of a given PID, however, I don't want to see other children of the ancestors that don't reach the current PID.
My goal is, from the tree result, i have to fetch a particular parent process by keyword, and if any other children from parents have the same... (2 Replies)
Discussion started by: ysrini
2 Replies
3. Programming
Hi friends,
I have a small question regarding unix system call fork, I hope you will solve my problem. Here is the small program
$ cat fork1.c
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
int main()
{
int pid;
int x = 0;
x = x + 1;
pid = fork();
if(pid < 0)
{... (2 Replies)
Discussion started by: gabam
2 Replies
4. Shell Programming and Scripting
Hello!
I saw that there were a few differente ways to do math within bash scripts.
expr and bc are possibilities. But which one to use when?
I want to make an simple bash script for children to do math.
The script must ask only questions like 1*1= till 10*10= ...
No + or - or /... (10 Replies)
Discussion started by: ugurgazi
10 Replies
5. Programming
Assume you have such a piece of (more or less pseudo-)code:
if(fork() == 0) {// childprocess
chmod(someProgram, 00777);
exec(someProgram);
} else { // assume it never fails and this is the parent
chmod(someProgram, 00000); // should be executed as soon as possible after the... (5 Replies)
Discussion started by: disaster
5 Replies
6. Programming
Hi gurus can you explain following lines of code ?
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
int main(void)
{
pid_t pid;
int rv;
switch(pid = fork()) {
case -1:
... (7 Replies)
Discussion started by: wakatana
7 Replies
7. Shell Programming and Scripting
hi experts(novice people can stay away as it is no child's game),
i am developing a script which works like recycle bin of windows.
the problem i am facing is that when ever i am trying to delete a file which is situated in parent directory or parent's parent directory i am unable to... (1 Reply)
Discussion started by: yahoo!
1 Replies
8. Programming
Hello, I'm trying to implement a version of a bucketSort (kinda) server/client, but I'm having a VERY hard time on making the server behave correctly, when talking to the children, after it forks.
The server is kinda big (300+ lines), so I won't post it here, but here's what I'm doing.
1)create a... (8 Replies)
Discussion started by: Zarnick
8 Replies
9. Programming
hi there, im trying to produce this program that would run at first, and when it runs it will fork one child process to a program and then another forking to run this other program, and then another one .
i cant seem to get it right can someone help me please here is what is got so far:
int... (1 Reply)
Discussion started by: zmanultra
1 Replies