Assign grep count to variable

To assign the output of a command, use var=$(cmd) (as shellcheck automatically tells you if you paste your script there). #!/bin/bash some_var=$(grep -c “some text” /tmp/somePath) echo “var value is: ${some_var}”

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