They say if you want to learn something, teach.
Or scratch your own itch.
Or just do it.
In any case, I had an itch that I have been wanting to find a fix for for a while.
If you are a developer like me, you began figuring this “WordPress thing” out through tutorials, trial and (mostly) error, and trying a lot of different things out.
Also, if you’re like me, you got into this for several reasons, one of which is the joy of helping people out and getting them a website setup and launched. I love the satisfaction of getting that project launched and the joy these folks have when they realize they can manage their own publishing.
And of course, if you’re a developer like me, you have a shared hosting account with at least a dozen different websites that are small personal projects or folks on the “friends and family plan” (read “free hosting” 🙂 ). This means I have a dozen or so sites I want to make sure I keep updated, but don’t want to spend a lot of time updating.
So, I decided to learn enough bash to write a script that would execute WP-CLI commands on my local environment as well as my shared hosting.
Here’s how I did it…