Zabbix Documentation 4.4 (current)| In development:5.0 (devel)| Unsupported:

User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
manual:appendix:protocols:header_datalen [2019/05/14 07:15]
vso ZBX-16123 fixed bash script
manual:appendix:protocols:header_datalen [2019/05/14 08:05] (current)
vso ZBX-16123 fixed for loop to work on older bash versions
Line 23: Line 23:
 printf -v LENGTH '​%016x'​ "​${#​DATA}"​ printf -v LENGTH '​%016x'​ "​${#​DATA}"​
 PACK=""​ PACK=""​
-for i in {14..0..-2}; do PACK="​$PACK\\x${LENGTH:​$i:​2}";​ done+for (( i=14; i>=0; i-=)); do PACK="​$PACK\\x${LENGTH:​$i:​2}";​ done
 printf "​ZBXD\1$PACK%s"​ "​$DATA"​ printf "​ZBXD\1$PACK%s"​ "​$DATA"​
 </​code>​| </​code>​|