Using PHP in place of Bash

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
liderbug
Forum Newbie
Posts: 19
Joined: Tue Jul 23, 2002 2:18 pm

Using PHP in place of Bash

Post 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....
.........
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

nothing to add except <? only works with short tags enabled, use <?php to be on the safe side
Daedalus
Forum Newbie
Posts: 3
Joined: Mon Nov 11, 2002 3:45 pm

Post 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.
Post Reply