Zabbix Documentation 4.4

3.04.04.4 (current)| In development:5.0 (devel)| Unsupported:1.82.02.22.43.23.44.2Guidelines

User Tools

Site Tools


manual:appendix:protocols:header_datalen

Differences

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 [2018/12/07 06:52]
martins-v header info updated
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>​|
 |Java|<​code Java> |Java|<​code Java>