title: KornShell - Set "-x" (debug) flag globally?
body: <p>Is there a way to set the debug mode (<a href="http://www2.research.att.com/sw/download/man/man1/ksh.html" rel="nofollow noreferrer"><code>set -x</code></a>) on a KornShell (ksh) script globally?  Currently it seems I have do something like the following:</p>
  <pre><code>a(){
     set -x
     #commands
  }
  
  b(){
     set -x
     #more commands
  }
  
  set-x 
  a
  #commands
  b
  </code></pre>
  <p>I would really like to only have to call the <code>set -x</code> command in one place.</p>
  <p><strong>Note:</strong> This is all in KSH88 on AIX.</p>
  <p>Example:</p>
  <pre><code>#!/bin/ksh
  set -x
  
  a(){
     echo &quot;This is A!&quot;
  }
  
  b(){
     echo &quot;This is B!&quot;
  }
  
  a
  echo &quot;Outside&quot;
  b
  </code></pre>
  <pre><code>dev2:/home/me-&gt; ./testSetX
  + a
  This is A!
  + echo Outside
  Outside
  + b
  This is B!
  dev2:/home/me-&gt;
  </code></pre>