I am trying to execute cqlsh inside bash script. My script is below. When ı try to execute sh file, it returns cql command not found
#!/bin/bash
set -x
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
cqlsh -e "SELECT * FROM msg.msg_log limit 1;" > /home/yunus/sh/cqlshcontrol.txt
error1=$( more /home/yunus/sh/cqlshcontrol.txt | wc -l )
if [ $error1 -lt 1 ]; then
curl -S -X POST --data "payload={\"text\": \" Cqlsh not responding, Connection Problem \",\"username\":\"Elevate Cassandra1\",\"icon_emoji\":\"${SLACK_ICON}\"}" https://hooks.slack.com/services/
fi