• add -u option (POSIX: unbuffered ⇒ nop) to the built-in cat

• PIPESTATUS now supported (like bash 2) whose last member
  may actually differ from $? since the latter may not be the
  result of a pipeline partial command
• add regression tests, documentation, etc.
This commit is contained in:
tg
2011-02-18 22:26:13 +00:00
parent 36d41ed9ee
commit 0b57abd4d3
7 changed files with 130 additions and 38 deletions

3
main.c
View File

@ -33,7 +33,7 @@
#include <locale.h>
#endif
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.176 2011/02/11 01:18:18 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.177 2011/02/18 22:26:10 tg Exp $");
extern char **environ;
@ -364,6 +364,7 @@ main(int argc, const char *argv[])
vp->flag |= INT_U;
setint((vp = global("RANDOM")), rndsetup());
vp->flag |= INT_U;
setint((vp_pipest = global("PIPESTATUS")), 0);
/* Set this before parsing arguments */
Flag(FPRIVILEGED) = kshuid != ksheuid || kshgid != kshegid;