Making processes using fork


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Making processes using fork
# 1  
Old 04-18-2013
Making processes using fork

Can anyone help me with this?

Create a parent process that gets from the command line n arguments arg1, arg2, ... , argn.
The parent will create n/3 son processes, each of them will create a file with the name argi by concatenate the files argi+1 and argi+2.

How can i concatenate those files?
# 2  
Old 04-18-2013
Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Programming

Issue when fork()ing processes

Hi guys! I'll simplify my problem. I have the following code: #include <fcntl.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <signal.h> #include <fcntl.h> #include <unistd.h> #include <sys/wait.h> #define max 25 #define buffdim 50 void p1(); void p2();... (2 Replies)
Discussion started by: pfpietro
2 Replies

2. Programming

Creating more processes with fork()

Hello people I need help How to make ONE process to create MORE (not one) processes with fork(). I tried several codes but do not work. Thanks (8 Replies)
Discussion started by: nekoj
8 Replies

3. Shell Programming and Scripting

fork processes

Hi, How to count how many processes opened by fork function in perl. Thanks (10 Replies)
Discussion started by: Anjan1
10 Replies

4. Programming

fork(), parent and child processes???

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

5. UNIX for Dummies Questions & Answers

Conserving processes: execve() vs fork()

Disclaimer: This is just a rainy day experiment. There is no expected "goal" other than to understand UNIX better. After reading about fork and exec, my understanding is that forking, as the UNIX shell does by design, consequentially may sacrafice some speed versus an approach that runs in... (1 Reply)
Discussion started by: uiop44
1 Replies

6. SCO

-sh: fork failed - too many processes in sco unix 5.0.5

Dear experts, I have done a re-installation of sco unix openserver 5.0.5 and managed to create users. The problem am facing is that of one user logging in more than 5 times. How can i overcome this problem. the system give the error below. -sh: fork failed - too many processes in sco unix... (5 Replies)
Discussion started by: njoroge
5 Replies

7. Shell Programming and Scripting

fork() and child processes

Hello, How many child processes are actually created when running this code ? #include <signal.h> #include <stdio.h> int main () { int i ; setpgrp () ; for (i = 0; i < 10; i++) { if (fork () == 0) { if ( i & 1 ) setpgrp () ; printf ("Child id: %2d, group: %2d\n",... (1 Reply)
Discussion started by: green_dot
1 Replies

8. Programming

fork() and child processes

Hello, How many child processes are actually created when running this code ? #include <signal.h> #include <stdio.h> int main () { int i ; setpgrp () ; for (i = 0; i < 10; i++) { if (fork () == 0) { if ( i & 1 ) setpgrp () ; printf ("Child id: %2d, group: %2d\n", getpid(),... (0 Replies)
Discussion started by: green_dot
0 Replies

9. Shell Programming and Scripting

making shellvariables public to child processes

Hi, I'm looking for a possibility to make variables of the shell public to child processes. Usually I would try set -a but an error message appears: ./decrypt.pgm: -a^M: bad option(s) where decrypt.pgm is the name of the shell script. Any help welcome! Cheers Martin (2 Replies)
Discussion started by: martinn
2 Replies
Login or Register to Ask a Question