I use perl almost every day on command line level to replace certain strings in bash scripts, but until now, I never had to use bash variables. For some reason, they don't seem to work as well. Hopefully someone has a solution for the below:
Within the perl line, the variable is blank. What am I doing wrong?
Code:
#!/bin/sh
THISIP=`/sbin/ifconfig ${DEFAULTNIC} | grep 'inet addr:' | cut -d: -f2 | cut -d\ -f1`
perl -pi -e 's/# ListenIP=0.0.0.0/ListenIP=${THISIP}/' /etc/zabbix/zabbix_agentd.conf
Within the perl line, the variable is blank. What am I doing wrong?