LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 11-05-2004, 06:55 PM   #1
naflan
Member
 
Registered: May 2003
Location: NC, USA
Distribution: Slackware 13.0
Posts: 91

Rep: Reputation: 15
php command line scripts


I just discovered that php can be used to write shell scripts. Anyone ever try this?



php command line
 
Old 11-05-2004, 07:10 PM   #2
musicman_ace
Senior Member
 
Registered: May 2001
Location: Indiana
Distribution: Gentoo, Debian, RHEL, Slack
Posts: 1,555

Rep: Reputation: 46
Most web developers use this as well as the DB connecting functions to create dynamic contect generation.
 
Old 11-07-2004, 02:07 PM   #3
mgatny
Member
 
Registered: Mar 2004
Posts: 41

Rep: Reputation: 15
This is a rather excellent feature of PHP, and it really makes sense when:

- You have an existing body of code that you are running within your webserver, and you want to leverage that when writing maintenance scripts, e.g. cron jobs.

- You're an experienced PHP developer, but are not familar enough with the UNIX shell, or other scripting options languages like Perl and Python.
 
Old 11-09-2004, 12:34 AM   #4
sheds
Member
 
Registered: Oct 2004
Location: Costa Rica
Distribution: Mandrake 9.1
Posts: 30

Rep: Reputation: 15
How does this work? I heard about it but i have no idea how that goes.
 
Old 11-09-2004, 08:05 AM   #5
naflan
Member
 
Registered: May 2003
Location: NC, USA
Distribution: Slackware 13.0
Posts: 91

Original Poster
Rep: Reputation: 15
Quote:
How does this work? I heard about it but i have no idea how that goes.
See here

Last edited by naflan; 11-09-2004 at 08:07 AM.
 
Old 11-09-2004, 09:02 AM   #6
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 242Reputation: 242Reputation: 242
It is good to test quickly some php code...
Code:
php -r 'echo str_replace("borks", "rocks", "php in command line borks")."\n";'

Last edited by Cedrik; 11-09-2004 at 09:03 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[php] accessing command line dtra Linux - Software 1 04-26-2005 08:19 PM
php from command line odious1 Linux - Software 4 05-03-2004 01:31 AM
Change kde theme & wallpaper from command line or start scripts? JHuizingh Linux - Software 2 12-11-2003 07:44 PM
PHP execute at command line gjmwalsh Mandriva 2 12-06-2003 02:03 AM
Command to list line length of multiple scripts Tekime Linux - General 2 09-06-2002 02:04 AM


All times are GMT -5. The time now is 02:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration