iRules/Tcl – Watch the Comments
It’s pretty common practice to ‘comment out’ lines in scripts. The code stays in place, but doesn’t get executed. Perfect for testing, when you might need more debug output, or you want to run a slightly different set of actions. But you have to be careful when commenting out lines – it might catch you out, and the F5 iRules editor won’t save you.
Normally it’s pretty simple to comment out a line. Here’s a quick Bash example:
#!/bin/bash FILECOUNT=`ls /tmp|wc -l` if [ $FILECOUNT -lt 7 ] then echo "There are fewer than 7 files in /tmp" run_command fi ...
When I’m testing the script, I might not want to actually run that command. So I’ll quickly comment it out like this:
#!/bin/bash FILECOUNT=`ls /tmp|wc -l` if [ $FILECOUNT -lt 7 ] then echo "There are fewer than 7 files in /tmp" #run_command fi ...
The ‘#’ tells the shell to ignore anything else on that line. All pretty straightforward.
Today I was debugging an F5 synchronisation issue, where I got this message on synchronisation:
BIGpipe parsing error (/config/bigip.conf Line 333): 012e0054:3: The braced list of attributes is not closed for 'rule'.
The offending section looked like this:
when Continue reading