Processes create/join


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Processes create/join
# 1  
Old 10-21-2008
Processes create/join

I'm working with some code in php that creates a process and I want the main program to wait till that process is done running then come back and join.
<code>
$pid = pcntl_fork();
if ($pid == -1){
die('could not fork');
}
else if ($pid){
pcntl_wait($status);
}
else{
echo shell_exec($command);
}
<code>
$command is a variable which has the name of the program (and it's arguments) I am trying to run as a new process and that's what I want to wait for. I'm pretty new at this php stuff so if anyone could help with this I'd appreciate it.

Additionally if it is possible to display something to the web page screen to let the user know the process is working(because it takes a minute or so) and then let them know once the process has joined that would also help immensly. Thanks for your help with this.
# 2  
Old 10-22-2008
bump. need Smiliehelp
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Join, merge, fill NULL the void columns of multiples files like sql "LEFT JOIN" by using awk

Hello, This post is already here but want to do this with another way Merge multiples files with multiples duplicates keys by filling "NULL" the void columns for anothers joinning files file1.csv: 1|abc 1|def 2|ghi 2|jkl 3|mno 3|pqr file2.csv: 1|123|jojo 1|NULL|bibi... (2 Replies)
Discussion started by: yjacknewton
2 Replies

2. Shell Programming and Scripting

Alignment tool to join text files in 2 directories to create a parallel corpus

I have two directories called English and Hindi. Each directory contains the same number of files with the only difference being that in the case of the English Directory the tag is .english and in the Hindi one the tag is .Hindi The file may contain either a single text or more than one text... (7 Replies)
Discussion started by: gimley
7 Replies

3. Shell Programming and Scripting

Comparing two files in UNIX and create a new file similar to equi join

I have 2 files namely branch.txt file & RXD.txt file as below Ex:Branch.txt ========================= B1,Branchname1,city,country B2,Branchname2,city,country B3,Branchname3,city,country B4,Branchname4,city,country B5,Branchname5,city,country RXD file : will... (11 Replies)
Discussion started by: satece
11 Replies

4. UNIX for Dummies Questions & Answers

How to use the the join command to join multiple files by a common column

Hi, I have 20 tab delimited text files that have a common column (column 1). The files are named GSM1.txt through GSM20.txt. Each file has 3 columns (2 other columns in addition to the first common column). I want to write a script to join the files by the first common column so that in the... (5 Replies)
Discussion started by: evelibertine
5 Replies

5. Homework & Coursework Questions

create a program that runs two processes linked oven

I need help program in C... :create a program that runs two processes linked oven (1 Reply)
Discussion started by: gizmo16
1 Replies

6. Shell Programming and Scripting

Create log for finished processes

Hi, I'm doing a script that generate some background process like for file in `find $dir -type f -maxdepth 1 -mtime -1`; do exp="java -cp process.jar testing $file &" eval $exp echo $! #Get the PID echo $(basename $file) >> log done Is there a way to know when those... (1 Reply)
Discussion started by: amondracorp
1 Replies

7. UNIX for Dummies Questions & Answers

Join 2 files with multiple columns: awk/grep/join?

Hello, My apologies if this has been posted elsewhere, I have had a look at several threads but I am still confused how to use these functions. I have two files, each with 5 columns: File A: (tab-delimited) PDB CHAIN Start End Fragment 1avq A 171 176 awyfan 1avq A 172 177 wyfany 1c7k A 2 7... (3 Replies)
Discussion started by: InfoSeeker
3 Replies

8. Programming

sql,multiple join,outer join issue

example sql: select a.a1,b.b1,c.c1,d.d1,e.e1 from a left outer join b on a.x=b.x left outer join c on b.y=c.y left outer join d on d.z=a.z inner join a.t=e.t I know how single outer or inner join works in sql. But I don't really understand when there are multiple of them. can... (0 Replies)
Discussion started by: robbiezr
0 Replies

9. Programming

programatic ways to create background processes in C/C++

How can we create a background process programmatically? One way I know of is to fork() and exit from the parent process, leaving the child running. It will run as a background process. I would like to know if there are any other ways. In perticular how are daemon processes created? (1 Reply)
Discussion started by: ipzig
1 Replies

10. UNIX for Advanced & Expert Users

how i write script to create 30 processes

helo i make one process for com port . in that i create two thread one for reading data and another for writing data to com port. now i want to write a script which create 30 processes for handling 30 com port. is it good solution for handling 30 com port. Thx & Regards, Amit (2 Replies)
Discussion started by: amitpansuria
2 Replies
Login or Register to Ask a Question