09:20
I'm testing what the return value of a fork looks like. In both Lua and Python I get similar results.
> On success, the PID of the child process is returned in the parent, and 0 is returned in the child.
I'm not exactly sure how to deal with this. Am I getting print values from two different processes? And if so, which do I treat as the return value?
7 hours later…
2 hours later…
17:53
@FaheemMitha I thought it was easier, but I see that most POSIX utilities are only required to use
0
for "no error" and > 0
for "something went wrong".
You may use
tput
. Examples: tput >/dev/null
(status == 2
, usage error), TERM=foo tput >/dev/null
(status == 3
, no information for the terminal type), tput foo >/dev/null
(status == 4
, unknown capability). It can also return 1
, which POSIX says is "unspecified" and historically used to tell the terminal doesn't have the specified capability (e.g. TERM=vt100 tput setaf >/dev/null
); notably, in this case the exit status is ≠ 0
, but no error message is printed out.
1 hour later…
2 hours later…
« first day (4026 days earlier) ← previous day next day → last day (1145 days later) »