Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have been developing web sites/applications using the LAMP stack for almost 5 years. Currently I am interested to dig more into Linux OS, specifically BASH but from a web developer perspective, not from sys admin perspective.

I am not intending to administrate Linux Servers. Only, I want to know, does learning shell scripting benefit me as a PHP developer? Does it make me a better, more skilled developer, or just its something irrelevant?

Reasons, and examples are highly appreciated.

Thanks in advance.

share

migration rejected from stackoverflow.com Jan 14 at 15:57

This question came from our site for professional and enthusiast programmers. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.

closed as primarily opinion-based by gnat, MichaelT, Kilian Foth, GlenH7, thorsten müller Jan 14 at 15:57

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
It's useful and beneficial. –  alex Jun 23 '11 at 6:05
3  
Because it's absolutely fantastic for bashing things. –  GWW Jun 23 '11 at 6:08
1  
It widens your perspective, gives you new options, new possible scenarios in certain cases. Certainly beneficial. And if you consider yourself a LAMP developer, why miss out on the L? –  kapa Jun 23 '11 at 6:09
    
Is your question about utilizing shell features via PHP ? –  mario Jun 23 '11 at 6:09
1  
Yep, you'll be a more skilled developer. You can actually do many (if not all) things that BASH can in PHP, sometimes in an easier way. So, from a web developer point of view, you might not achieve anything big, but still BASH is worth learning. –  LeleDumbo Jun 23 '11 at 6:17

2 Answers 2

As mentioned Cron and DB management for sure.

Currently I'm coding a BASH script that works in tandem with PHP scripts to process the message queue for a web to SMS aggregating service because PHP isn't capable of doing a bunch of filesystem checking stuff alone and it's better off using BASH to call them.

share

I can think of a few reasons

  • Cron jobs: Running PHP/Perl/Python scripts automatically at predefined times to perform background maintenance tasks.
  • Keeping your software stack (web server, database server, PHP/Perl/Python) up to date and installing/removing PHP extensions with pear, pecl, apt or rpm
  • Restarting your web server should a PHP script under test run away from you
  • Database maintenance and backup
share