Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Alternatives to sed + awk



> Adding a bit to what Josh said about Perl, if I am not 
> mistaken, I think PHP is primarily used for web development?

PHP is also a commandline tool, and works fine. It is not as terse as
perl, but your scripts will be of similar length to the python or ruby
version for things like scanning files, search-and-replace, socket
connections, web mining, etc.

There is even the -r flag to run commands without writing a script, e.g.
  php -r '$s=file_get_contents("http://tlug.jp/";);echo
strlen($s).",".substr_count($s,"Japan")."\n";'

The commandline version is usually installed separately by distros; on
Ubuntu/Debian you want the "php5-cli" package (*).

Under Centos/RH the package is called "php-cli".

Darren

*: You can also configure them differently if you wish, under /etc/php5
you'll find directories for apache2, cli and conf.d, the latter being
config used by both.


-- 
Darren Cook, Software Researcher/Developer

http://dcook.org/work/ (About me and my work)
http://dcook.org/blogs.html (My blogs and articles)


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links