Thread overview
shell doesn't throw on error. Is that a regression?
Feb 03, 2013
timotheecour
Feb 03, 2013
Andrej Mitrovic
Feb 03, 2013
timotheecour
Feb 03, 2013
timotheecour
February 03, 2013
The doc for std.process.shell says "If the process could not be started or exits with an error code, throws an exception."

However on OSX I'm having a different kind of behavior.
Isn't there a unittest to test this?

---
import std.process;
import std.stdio;

void main(){
	shell("asfasfasdfasdf");
	writeln("ok");
}
---
prints:

in dmd.2.061 - 2.059:
sh: asfasfasdfasdf: command not found
ok

in dmd.2.057:
sh: asfasfasdfasdf: command not found
std.exception.ErrnoException@std/stdio.d(418): Could not close pipe `asfasfasdfasdf' (Undefined error: 0)
February 03, 2013
On 2/3/13, timotheecour <thelastmammoth@gmail.com> wrote:
> Isn't there a unittest to test this?

The only unittest is unfortunately pretty bad:

unittest
{
    auto x = shell("echo wyda");
}

Please feel free to file a bug: http://d.puremagic.com/issues/enter_bug.cgi?product=D
February 03, 2013
here goes:
http://d.puremagic.com/issues/show_bug.cgi?id=9444

please see my added comment in 9444 regarding capturing std err instead of displaying it.
February 03, 2013
On Sunday, 3 February 2013 at 02:28:26 UTC, timotheecour wrote:
> here goes:
> http://d.puremagic.com/issues/show_bug.cgi?id=9444
>
> please see my added comment in 9444 regarding capturing std err instead of displaying it.

actually the new std.process pull request (http://forum.dlang.org/thread/k5uprq$obu$1@digitalmars.com) works well. I wonder when that'll get in master?