title: iwconfig grep output as part of a script
body: <pre><code>#!/bin/bash
  MAX=20
  while true
  do
  iwconfig wlan0 txpower $(((RANDOM % $MAX) +1))
  set -x #this was not originally included
  echo iwconfig wlan0 | grep Tx-Power
  done
  </code></pre>
  
  <p>So I am trying to have a small script vary the tx power of my device below the max. I had this working no problem a while back and have revisted the script now. Since then I have changed host and VM that this is running on and without the set-x it just hangs. Each line works individuall, but it will not output the echo to the screen when in a script.</p>
  
  <p>When I add the set -x it works but also echos set -x, done etc to the screen also. </p>
  
  <p>Any idea what has caused this change and how I could fix</p>
  
  <p>A </p>