[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
system(), shell, & stderr.
From: |
Francesco Potorti` |
Subject: |
system(), shell, & stderr. |
Date: |
Mon, 28 Aug 1995 11:42 +0100 (MET) |
I have no control over which shell "system(cmd)" executes cmd in.
It is whatever login shell the user has.
Seems not. I have ksh as login shell, but
system("echo $0") --> "sh"
Perhaps, an optional argument could be added to "system" to set
the shell, or some global variable. (SHELL)
Yes.
Also, perhaps system should have a mech. for trapping stderr,
like it already does for stdout.
Not a bad idea.
Without, reducing to a two-line shell script I can't see a way
to redirect stderr shell-independently.
Why not:
system("sh -c 'date 2>/dev/null'") --> Mon Aug 28 11:34:32 MET DST 1995
However, it looks like this is not necessary, because system() always
uses sh, on the alpha precompiled binary I use.
--
Francesco Potorti` | address@hidden (Internet)
researcher at | 39369::pot (DECnet)
CNUCE-CNR, Pisa, Italy | +39-50-593203 (voice) 904052 (fax)