www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - shell doesn't throw on error. Is that a regression?

reply "timotheecour" <thelastmammoth gmail.com> writes:
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)
Feb 02 2013
parent reply Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
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
Feb 02 2013
parent reply "timotheecour" <thelastmammoth gmail.com> writes:
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.
Feb 02 2013
parent "timotheecour" <thelastmammoth gmail.com> writes:
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?
Feb 02 2013