Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 02-11-2004, 08:19 AM   #1
RainMailer
Confirmed User
 
Join Date: Feb 2003
Location: Portland
Posts: 826
Any Shell Coders Out There?

Hey guys! I would like to write a shell script that opens sub shells to run multiple commands at one time. What i need the script to do is start for ex: 1.php then 2.php then 3.php . Can anyone help?

Thanks in Advance!
__________________
harbinc at gmail dot com
RainMailer is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-11-2004, 08:25 AM   #2
grumpy
Too lazy to set a custom title
 
grumpy's Avatar
 
Join Date: Jan 2002
Location: Holland
Posts: 9,870
explain a bit more...maybe i can help.
__________________
Don't let greediness blur your vision | You gotta let some shit slide
icq - 441-456-888
grumpy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-11-2004, 08:29 AM   #3
RainMailer
Confirmed User
 
Join Date: Feb 2003
Location: Portland
Posts: 826
I have 5 php scripts that I would like to code a shell script to run all the php scripts at the same time. I am going to create a cronjob to run the shell script instead of creating a cronjob to individually run each php script.
__________________
harbinc at gmail dot com
RainMailer is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-11-2004, 08:40 AM   #4
NetRodent
Confirmed User
 
Join Date: Jan 2002
Location: In the walls of your house.
Posts: 3,985
Depending on your shell...

#!/bin/sh
/path/to/php /path/to/1.php
/path/to/php /path/to/2.php
/path/to/php /path/to/3.php
__________________
"Every normal man must be tempted, at times, to spit on his hands, hoist the black flag, and begin slitting throats."
--H.L. Mencken
NetRodent is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-11-2004, 09:03 AM   #5
Brujah
Beer Money Baron
 
Brujah's Avatar
 
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
use run-parts and put them all in a directory, executable?

15 6 * * * run-parts /home/path/daily
__________________
Brujah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-11-2004, 09:04 AM   #6
com
Confirmed User
 
Join Date: Aug 2003
Location: Portland, Oregon
Posts: 4,541
Quote:
Originally posted by NetRodent
Depending on your shell...

#!/bin/sh
/path/to/php /path/to/1.php
/path/to/php /path/to/2.php
/path/to/php /path/to/3.php
what he said, then cron it
__________________

Real. Professional. Hosting.
.:Expect Nothing Less:.
320-078-843 :: www.realprohosting.com :: [email protected]
com is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-11-2004, 09:19 AM   #7
Big E
Registered User
 
Industry Role:
Join Date: Mar 2002
Location: San Diego, CA
Posts: 935
I think he said at the same time.. ?

Just add an ampersand after each command to put it in the background:

command &

You might need to redirect the output (check your shell man page):

command 2>&1 >/dev/null &
Big E is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.