Re: Bug#1132887: script: "script file -c command" stopped working

Evgeny Kapun <[email protected]> Wed, 8 Apr 2026 16:36:50 +0300
Newsgroups org.kernel.vger.util-linux
Message-ID <[email protected]>
On 4/7/26 16:26, Karel Zak wrote:
> I have created bugfix for this, see https://github.com/util-linux/util-linux/pull/4201

It seems that this fix doesn't handle the case where -- is used as an
argument to an option. For example, `script -I --` before v2.42 would
interpret -- as an argument to -I, but the pre-scanning in that PR would
break it.

The value can come from a variable, e.g. `script -I "$VAR"` and `script
--log-in "$VAR"` will usually work, but break if $VAR is --. Similarly,
`script "-I$VAR"` will usually work, but break if $VAR is the empty
string. The only approach without special cases seems to be `script
"--log-in=$VAR"`, but it doesn't seem to be very popular.