diff --git a/__call.cpp b/__call.cpp index 33ec9aa..1bd2c2b 100644 --- a/__call.cpp +++ b/__call.cpp @@ -1,6 +1,7 @@ #include "__call.h" #include "Exception.h" #include "MString.h" +#include #include #include #include @@ -10,8 +11,8 @@ namespace jet { __call::__call(coreutils::ZString &in, coreutils::MString &out, Global &global) : Tag(in, out, global) { if(hasContainer) - throw coreutils::Exception("call cannot have a container."); - if(!variableDefined(coreutils::ZString("pgm"))) + throw coreutils::Exception("call tag cannot have a container."); + if(!variableDefined("pgm")) throw coreutils::Exception("pgm keyword must be specified."); argv[0] = variables["pgm"].c_str(); // TODO: Need to peel off the program name only and pass as argv[0]. for(ix = 1; ix <= 50; ++ix) { @@ -42,7 +43,6 @@ namespace jet { } rc = execve(variables["pgm"].c_str(), argv, NULL); close(fdo[1]); - std::cout << "rc: " << rc << std::endl; exit(rc); } close(fdo[1]); @@ -51,6 +51,8 @@ namespace jet { else out.read(fdo[0]); waitpid(pid, &status, 0); + if(variableDefined("status")) + global.variables[variables["status"]] = (status >> 8 & 255); } } diff --git a/__system.cpp b/__system.cpp index d2157fc..9190cd6 100644 --- a/__system.cpp +++ b/__system.cpp @@ -10,7 +10,7 @@ namespace jet { __system::__system(coreutils::ZString &in, coreutils::MString &out, Global &global) : Tag(in, out, global) { if(hasContainer) - throw coreutils::Exception("call cannot have a container."); + throw coreutils::Exception("system tag cannot have a container."); if(!variableDefined(coreutils::ZString("pgm"))) throw coreutils::Exception("pgm keyword must be specified."); argv[0] = variables["pgm"].c_str(); // TODO: Need to peel off the program name only and pass as argv[0]. diff --git a/jet-2.0 b/jet-2.0 index 8ddace9..f90e007 100755 Binary files a/jet-2.0 and b/jet-2.0 differ diff --git a/testjet.jet b/testjet.jet index f08ece1..7b77dc0 100755 --- a/testjet.jet +++ b/testjet.jet @@ -50,8 +50,9 @@ -->#[ix]<-- - - $[lsi] + + $[rc] + $[ls] $[filex]