I have input list with full enterprise host list(/home/completehostlistcheck.txt). Depending on which environment it lies (compare the input from dev=/home/dev.txt and prod=/home/prod.txt) run echo and say which environment it lies. Problem is case syntax is not working
#!/bin/bash
dev=/home/dev.txt
prod=/home/prod.txt
for host in $(</home/completehostlistcheck.txt)
do
ssh $host
chk=$hostname
case "$chk" in
dev) echo "this is dev"
;;
prod) echo "this is prod"
;;
esac
done