Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jun 7th, 2007, 12:25 AM   #1
grimpirate
King of Portal
 
grimpirate's Avatar
 
Join Date: Sep 2005
Posts: 437
Rep Power: 4 grimpirate is on a distinguished road
Send a message via Yahoo to grimpirate
Question Executing two scripts concurrently on your home machine

I'd like to know how I can run the same script twice (on the command line or even in my browser) so that I can get overlapping outputs on my windows machine. So, for instance if the script were something simplistic like the following:[PHP]<?php
while(true){
fwrite(STDOUT, "Process ID: " . getmypid() . "\n");
sleep(1);
}
?>[/PHP]The output in the command line would be something along the lines of:
Process ID: 3894
Process ID: 3894
Process ID: 3894
Process ID: 2295
Process ID: 3894
Process ID: 2295
...
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis
grimpirate is offline   Reply With Quote
Old Jun 7th, 2007, 10:07 AM   #2
dr.p
Programmer
 
dr.p's Avatar
 
Join Date: Feb 2006
Location: Ohio
Posts: 93
Rep Power: 3 dr.p is on a distinguished road
I would probably write a Perl script (on windows) that creates one or more child processes that each connect to the given URL and download the results to a local, temporary, HTML file. Then, if possible, the script would display the local pages in my default browser for me.

But, why do you want to do this?
__________________
Neeley.org
dr.p is offline   Reply With Quote
Old Jun 7th, 2007, 11:47 AM   #3
grimpirate
King of Portal
 
grimpirate's Avatar
 
Join Date: Sep 2005
Posts: 437
Rep Power: 4 grimpirate is on a distinguished road
Send a message via Yahoo to grimpirate
I wanted to do this to test a file locking mechanism. I was actually just sort of hoping it would be some sort of command line input I had to enter. I just opened up to command prompts and typed in the same command, ALT+TAB really quick and got some overlapping instructions. Not the most efficient way to look at the output lol but it JUST met the requirements. Needless to say the file-locking mechanism I was trying to implement didn't work.
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis
grimpirate is offline   Reply With Quote
Old Jun 10th, 2007, 6:49 AM   #4
mackenga
Professional Programmer
 
Join Date: Mar 2005
Location: Glasgow, Scotland
Posts: 317
Rep Power: 4 mackenga is on a distinguished road
Sadly the Windows command-line shell is a bit restrictive. Hailing from the days of non-multitasking OSes it doesn't spawn background processes conveniently like Unix shells do. Even its I/O redirection is still pretty poor. I pity people stuck developing and testing on Win32 - it's such a weird, archaic system.
__________________
"I'm not a genius. Why do I have to suffer?"
mackenga is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
understanding scripts Special T Delphi 0 Oct 24th, 2006 9:26 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 8:19 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC