[CentOS] Syntax Help on a Bash Script

Andrew Harley andrew.harley at mdi.net.au
Wed May 4 04:49:22 UTC 2011


On Tue, 2011-05-03 at 23:33 -0500, Robert wrote:
> MYSQL='which mysql'

Also this line should use either backticks or $() command substitution
instead:

For example:

[andrew at savoy ~]$ MYSQL='which mysql'
[andrew at savoy ~]$ echo $MYSQL
which mysql
[andrew at savoy ~]$ MYSQL=$(which mysql)
[andrew at savoy ~]$ echo $MYSQL
/usr/bin/mysql
[andrew at savoy ~]$ MYSQL=`which mysql`
[andrew at savoy ~]$ echo $MYSQL
/usr/bin/mysql

Cheers!

--

Andy




More information about the CentOS mailing list