tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: [PATCH 0/6] script(1) cleanups, -e to pass through exit code



On Wed, Jan 05, 2022 at 05:13:48AM +0700, Robert Elz wrote:
>     Date:        Tue, 4 Jan 2022 16:15:22 +0100
>     From:        =?utf-8?B?0L3QsNCx?= <nabijaczleweli%nabijaczleweli.xyz@localhost>
>     Message-ID:  <20220104151522.xxuplfq76gj6ewco%tarta.nabijaczleweli.xyz@localhost>
>
>   | Because system(3) forks and waits, again.
> Is that really a serious problem in script?
I mean, it's inconsistent, SIGTERMs the whole process group as-written,
and wastes a process for no reason,

>     | system(3) just sucks.
> It does for this, but that will get fixed.
Agree: just exec()ing here as in the other branch
does fix these problems.

>   | As it stands, and, for compatibility, presumably as it will
>   | stand, script takes a shell program, not a command, and
> In the shell, what you are calling a program is kind of a command
> (not quite, it is more a list).  Certainly things like for ...
> and { ... } are commands.
I'm not calling for a program: shells execute programs, just like perl
or any other interpreter. The argument to -c *is* a shell program.
(Those do consist of a command list, I guess, but, nihil ad rem.)

>   | it's still important to note this,
>   | because the string is subject to shell expansion.
> Sure, it could say "is run by /bin/sh", but there's no need to
> have people race off to the sh manual to find out what -c means,
> if they don't already know.
I mean, I wouldn't say I necessarily agree because that's a weird way to
phrase this that I haven't come across, but it does work, I guess?

наб

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index