Forum Discussion
Jay_PL
Mar 31, 2018Nimbostratus
Hi,
I tried this script. Getting the same error.
'B_Capture.txt: line 6: syntax error near unexpected token
'B_Capture.txt: line 6:
for VS in $VIRTUALS;
added "!/bin/bash" on top of the script as well.
+++++++++++++++++++++ tmp cat LB_Capture.txt
!/bin/bash Making headings & intialize the fileecho Virtual-Server, Destination, Pool, Pool-Members > /var/tmp/$HOSTNAME.csv
Capture all virtuals in the LTMVIRTUALS=$(tmsh list ltm virtual | grep "ltm virtual" | cut -d" " -f3) for VS in $VIRTUALS; do DEST=$(tmsh list ltm virtual $VS | grep destination | cut -d" " -f6) POOL=$(tmsh list ltm virtual $VS | grep pool | cut -d" " -f6) if [ -n "$POOL" ]; then MBRS=$(tmsh list ltm pool "$POOL" | grep address | cut -d" " -f14) fi echo $VS,$DEST,$POOL,$MBRS >> /var/tmp/$HOSTNAME.csv done +++++++++++++++++++++++
Do suggest!!