Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
This one is to install Microsoft sqlcmd command-line tools on AWS Linux
echo "Installing SqlCmd.."
if [[ $(sqlcmd | grep Version) != *"13."* ]]; then {
rm -f ${repoPrConf}
cat >> ${repoPrConf} << EOF
enabled = 0
chmod 644 ${repoPrConf}
curl > /etc/yum.repos.d/msprod.repo
yum update -y
ACCEPT_EULA=y yum install mssql-tools -y
sudo ln -s /opt/mssql-tools/bin/sqlcmd /usr/local/bin
if [[ $(sqlcmd | grep Version) != *"13."* ]]; then {
echo "SqlCmd has been installed with error"
exit 1
} else {
echo "SqlCmd has been installed successfully"
} else {
echo "SqlCmd has been already installed"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment