title: ksh set-o pipefail is not inherited by scripts
body: <p>I would like to have set -o pipefail set "always" (.kshrc) but consider the following trivial example:</p>
  
  <pre><code>#!/bin/ksh
    function fun {
        return 99
    }
  if [[ $1 == 'pipe' ]] ; then
     set -o pipefail
  fi
  if fun | tee /tmp/bork.txt ; then 
      print "fun returned 0"
  else
      print "fun nonzero"
  fi
  
  This results in:
  /home/khb&gt;./b pipe    
  fun nonzero                          GOOD what we want
  /home/khb&gt;./b                        
  fun returned 0                       What we expect without pipefail!
  /home/khb&gt;set -o pipefail
  /home/khb&gt;./b
  fun returned 0                 BAD: expected the set to impact inferior shells
  </code></pre>
  
  <p>No doubt this should be obvious, but other than creating an environment variable and having every script reference it ... or sourcing a common set of definitions ... what other options are there to arrange for this option to be "found" in each script?</p>
  
  <p>Thanks in advance.</p>