Shell Script output weired output behaviour

Hello Experts,

I have an issue with a shell script which is giving different output on different servers.

Script below:
arp=“arp”
for ips in `cat iplist.txt`; do
rm -rf /tmp/$ips.txt
for vrf in `cat vrf_id.txt`; do
echo “Getting ARPs against IP…”
echo “/usr/bin/expect get_arp.exp $ips $vrf $arp”
#get_tech_output=$(/usr/bin/expect get_arp.exp $ips $vrf >> /tmp/$ips.txt)
#get_error=$(cat /tmp/$ips.txt | egrep -v ‘:’ > $ips"_vrf_with_error".txt )
done
done

Output I am getting:
Getting ARPs against IP…
arp/bin/expect get_arp.exp 172.21.166.198 2060696268
Getting ARPs against IP…
arp/bin/expect get_arp.exp 172.21.166.198 2060696269
Getting ARPs against IP…
arp/bin/expect get_arp.exp 172.21.166.198 2060696261

On a different machine, same script output is displaying correct:
Getting ARPs against IP…
/usr/bin/expect get_arp.exp 172.21.166.198 2060696268 arp
Getting ARPs against IP…
/usr/bin/expect get_arp.exp 172.21.166.198 2060696269 arp

Not sure of what reason. Please anyone help me on this.

Regards
Kasi


Linux sysadmin blog - Linux/Unix Howtos and Tutorials - Linux bash shell scripting wiki