How do I get a part of the output of a command in Bash?
For example, the command php -v outputs:
PHP 5.3.28 (cli) (built: Jun 23 2014 16:25:09)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies with the ionCube PHP Loader v4.6.1, Copyright (c) 2002-2014, by ionCube Ltd.
And I only want to output the PHP 5.3.28 (cli) part. How do I do that?
I've tried php -v | grep 'PHP 5.3.28', but that outputs: PHP 5.3.28 (cli) (built: Jun 23 2014 16:25:09) and that's not what I want.