nmh-workers
[Top][All Lists]
Advanced

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

Re: [Nmh-workers] Starting the final call for features for 1.7


From: Ralph Corderoy
Subject: Re: [Nmh-workers] Starting the final call for features for 1.7
Date: Wed, 12 Oct 2016 10:51:38 +0100

Hi Oliver,

> Just two failures left:
>     usage: script [ -a ] [ typescript ]
...
> This is a new check with the welcome message stuff.  Judging from
> online man pages for script, this will have problems on other systems
> too. OpenBSD for example, only seems to have a -a option for script.
> Can't we redirect standard input on it to provide the command?

I doubt it.  I think the test is mhparam(1)'s checking for a TTY on FDs
0, 1, and 2.  OpenBSD's man page says $SHELL is used.  Perhaps the test
can make use of this.

    $ cat >cmd
    #! /bin/sh

    mhparam path
    $ chmod +x cmd
    $ SHELL=`pwd`/cmd script
    Script started, file is typescript
    mail
    Script done, file is typescript
    $ cat -A typescript
    Script started on Wed 12 Oct 2016 10:38:22 BST$
    mail^M$
    $
    Script done on Wed 12 Oct 2016 10:38:22 BST$
    $

> It took a bit of tracking down to find the bad substitution but it
> seems to be from the w3m invocation being passed ${charset:+-I
> "$charset"}
> 
> The space between -I and the charset is the problem.

Interesting.  bash and dash are both happy with the space here.

    $ unset foo; bar= xyzzy=42; echo ,${foo:+a b},${bar:+c d},${xyzzy:+e f},
    ,,,e f,
    $ echo ,${xyzzy:+e "$USER"},  
    ,e ralph,
    $

And my reading of POSIX says everything up to the closing brace is valid
for `word'.

> w3m doesn't seem to actually require that space so it could simply be
> removed.

Yep.  When two words are required, the test could be duplicated.

    ${charset:+-I} ${charset:+"$charset"}

-- 
Cheers, Ralph.
https://plus.google.com/+RalphCorderoy



reply via email to

[Prev in Thread] Current Thread [Next in Thread]