Page 1 of 1

Using PHP in place of Bash

Posted: Mon Nov 11, 2002 5:39 pm
by liderbug
I found that I can use PHP in place of Bash, Awk, etc. jobs that have
nothing to do with web pages. Any other discussions along these lines?

!#/usr/bin/php -q
<?
$List = file ("file");
foreach ($List as .......
$query = "select.....
while....
.........

Posted: Mon Nov 11, 2002 5:56 pm
by volka
nothing to add except <? only works with short tags enabled, use <?php to be on the safe side

Posted: Tue Nov 12, 2002 3:43 am
by Daedalus
Actualy there is alot of different things you can do with running PHP as a shell script. I would say there is enough functionality in PHP as a shell script as Perl has as a shell script.

There are also alot of cool things you can compile into PHP that are fun things to play with when ran from the command line. Process Forking, Shared memory, IPC and a ton of other things that are very usefull. I my self have written meny daemons for linux in PHP.