Created
November 14, 2011 16:32
-
-
Save decioferreira/1364366 to your computer and use it in GitHub Desktop.
Shell script and MySQL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# MySQL connection | |
user_name="your_user_name" | |
db_name="your_db_name" | |
# Return the result of the query to a variable | |
result=$(mysql -u $user_name $db_name -sN -e "SELECT 1") | |
# print message on screen | |
echo "The result was $result!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment