title: sudo E option does not work?
body: <p>Seems to me that if I write a shell script in <code>$HOME/path/to/script/myscript</code>, and <code>export PATH=$PATH:$HOME/path/to/script/</code> then <code>sudo -E myscript</code> should run the script right?</p>
  
  <p><a href="http://www.sudo.ws/sudo.man.html" rel="nofollow" title="From Sudo Man Page:">From sudo man page:</a></p>
  
  <blockquote>
    <p>‑E
    The ‑E (preserve environment) option indicates to the security policy that the user wishes to preserve their existing environment variables. The security policy may return an error if the ‑E option is specified and the user does not have permission to preserve the environment.</p>
  </blockquote>
  
  <p>But <code>sudo -E script</code> can't find the command. I know I can just add <code>/absolute/path/to/script/</code> to the files that determine the <code>PATH</code> variable for <code>sudo env</code>, but that's not the approach I want to take.</p>
  
  <p><strong>To address the comments:<br></strong>
  <b>@H2CO3</b>: I have seen <code>sudo sudo</code> floating around the net, and it bugs me tremendously, it's literally saying "Give me superuser permissions to run superuser". I don't know if it would solve the problem, but it seems like a fundamentally flawed approach. Then again I started using linux/bsd systems back in the mid 90's so I take issue with just the <code>sudo</code> command itself.<br>
  <strong>@rici</strong>: The script does have executable permissions, but that's definitely something to check whenever something doesn't run in *nix systems =)</p>