title: How to publish bytearray message with mosquitto_pub in bash
body: <p>I have a bash script which receive bytearray from python script and publish through mosquitto_pub but somehow bash is corrupting this data and on client side i am receiving wrong data.</p>
  <p><strong>BashScript:</strong></p>
  <pre><code>#!/bin/bash
  
  echo -ne $(python Status.py) | mosquitto_pub -h localhost -t &quot;component_status&quot; -s
  </code></pre>
  <p><strong>Snippet of Python:</strong>
  Following are last line of python script</p>
  <pre><code>print( bytearray(myobj.SerializeToString()) )
  sys.exit(0)
  </code></pre>
  <p>Same is working fine if I send this from python mqtt client, but I need to use shell for this purpose.</p>
  <p>I also tried files option of mosquitto_pub like below but same result</p>
  <pre><code>echo -ne $(python Status.py) &gt; status.bin
  mosquitto_pub -h localhost -t &quot;component_status&quot; -f status.bin
  </code></pre>
  <p>It look like bash is not able to understand bytearray.</p>