If you’ve ever written a bash script with variables, and know that it wasn’t your last one,Ā I promise you, you’ll love this wiki page.Ā It covers a whole lot of different ways to expand and manipulate variable values in bash, all on a single, conveniently organized page.
A cup of tea
The best way to get the full PHP version string
Jeff Geerling shares the best way to get the full PHP version string.Ā I’d think that “php –version” externally or “echo PHP_VERSION” internally would do the job.Ā However, that’s not exactly right, as there are a number of inconsistencies on different platforms.Ā The best option seems to be the combination of the PHP_MAJOR_VERSION, PHP_MINOR_VERSION, and PHP_RELEASE_VERSION constants.
$ php -r 'echo join(".",[PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION]);'
7.2.12
Ardbeg An Oa
jq: deep comparison of 5GB files
I’ve blogged about jq – a lightweight and flexible command line JSON processor – a few times already (look here and here).Ā Today I came across this blog post that showcases jq in deep comparison of really large JSON files (5 GB or so).Ā This is not something that I need on a daily basis, but I’m sure it’ll come in handy one day.