You are here: Re: [PHP] Question about apache-php concurrent process control « PHP « IT news, forums, messages
Re: [PHP] Question about apache-php concurrent process control

Posted by "Richard Lynch" on 07/22/05 11:15

On Tue, July 19, 2005 5:32 am, Liang ZHONG said:
> It sounds interesting. But since I am pretty new to PHP, I have some
> questions, naive maybe, about what you wrote.
>
> "#!/bin/sh\n/path/to/script/Send.php 12 &\n"
>
> What does the Send.php look like? I do not have idea how a shell
> interprets
> an php script and what the parameter 12 means here. If you do not mind,
> could you please also let me look at your Send.php?

I dunno what his Send script looks like, but that 12 isn't a 12 at all.

It's a 1 with a > symbol and then a 2.

The > symbol probably got eaten by somebody's email program somewhere
along the way.

See, in some Linux/Un*x shells (errr, like DOS prompt only not broken)
there is the idea of "standard output" which is where your basic output
messages go.

There is also "standard error" where your ERROR messages go.

On Linux/Unix file systems, stdout (standard output) is bound to a
"special" file which lives in /dev/1 -- it's not really really a file, but
a "device" but to send stuff to the "standard output" -- which is
generally your screen, you can just write it to /dev/1 and it gets there.

For shorthand, in shell scripts, you can just use "1" to mean "/dev/1"

Similarly, "standard error" is "/dev/2" and you can use "2"

So, what he really had was 1>2 which was saying:
Take anything that was supposed to go to 1 (standard output) and send it
(the > symbol) into 2 (standard error)

So he's telling the shell (operating system) to combine any normal output
into the error output so it's one big mess of output.

You can learn more about this stuff (though it may be a bit overwhelming
at first) by searching for "man bash" or reading an introductory Linux
textbook or resource on-line.

--
Like Music?
http://l-i-e.com/artists.htm

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация