Re: Bug#1132887: script: "script file -c command" stopped working
Karel Zak <[email protected]> Thu, 7 May 2026 10:45:39 +0200
| Newsgroups | org.kernel.vger.util-linux |
|---|---|
| Message-ID | <gz7k7kxnbqcitn5jqg5dgus76hjiyrwxscab55dlrlhtrxdenm@rroa5scdex65> |
On Wed, Apr 08, 2026 at 04:36:50PM +0300, Evgeny Kapun wrote:
> 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.
I have updated the patch to accept "--" as argument for your cases.
https://github.com/util-linux/util-linux/pull/4326
Karel
--
Karel Zak <[email protected]>
http://karelzak.blogspot.com