In Bash, how do I interpolate $(…) in a string?

$(...) and other forms of substitutions are not interpolated in single-quoted strings.

So if you want your date calculated, do

git commit -m "Database $(date '+%a %M:%H %h %d %Y')"

that is, the whole message string is double-quoted to allow $(...) to be interpolated while the argument to date is in single quotes to make it a single argument (passed to date).

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)