Alex Rivera | Logout

PHP vs BASH for CLI scripting?

Asked 2010-05-06T23:17:48.533
11

I have never used PHP with CLI, but I have seen scripts running with PHP code.

I was wondering:

  • Why should we use BASH, when PHP is so popular and is able to run in CLI?
  • What are the pros and cons with each one?
  • Should I use PHP for all CLI scripting in the future?
Edit
Report

1 Answer

7

Bash is more common for this type of application, simply by virtue of it being around forever. But when it comes to choosing one over the other. The language you already know is usually the better choice. Just because you will be more productive.

answered 2010-05-06T23:20:52.387

Your Answer