title: ZSH on Linux doesn't recognize valid options in a shell script
body: <p><code>zsh</code> doesn't recognize options set with <code>-o</code>, but <strong>only</strong> when its in a shebang, and on <code>Linux</code>.</p>
  
  <p>The following script fails on <code>zsh 5.0.2</code>, <code>zsh 5.6</code>, and the latest git:</p>
  
  <pre><code>#!/bin/zsh -o pipefail
  thiswillfail | echo 'hello, world'
  echo $?
  exit
  </code></pre>
  
  <p><strong>Expected Output</strong></p>
  
  <pre><code>hello, world
  /home/prajjwal/script:2: command not found: thiswillfail
  127
  </code></pre>
  
  <p><strong>Actual Output</strong></p>
  
  <pre><code>/bin/zsh: no such option:  pipefail
  </code></pre>
  
  <p><strong>What works</strong></p>
  
  <ul>
  <li>The script on <code>zsh 5.3</code> on <code>MacOS Mojave</code>. This appears to be failing on every <code>Linux</code> version I've tried so far, though.</li>
  <li>Manually invoking <code>/bin/zsh -o pipefail</code> on a terminal</li>
  <li>Setting the option with <code>set -o pipefail</code> <strong>after</strong> the shebang in the script.</li>
  </ul>
  
  <p><strong>What I've tried</strong></p>
  
  <ul>
  <li>Emptying my <code>.zshrc</code>'s to ensure one of my settings isn't causing this.</li>
  </ul>
  
  <p><strong>Aside</strong></p>
  
  <p>While I'm only trying to get <code>pipefail</code> to work, this refuses to work with any other options that I try to set, even though all of them are mentioned in <code>zshoptions</code>.</p>