[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Shellology: ksh93 from OpenIndiana ${1+"$@"}
From: |
Pavel Raiskup |
Subject: |
Shellology: ksh93 from OpenIndiana ${1+"$@"} |
Date: |
Thu, 10 Dec 2015 14:55:32 +0100 |
User-agent: |
KMail/4.14.10 (Linux/4.2.6-301.fc23.x86_64; KDE/4.14.14; x86_64; ; ) |
Bob sent me a bug report that libtool's testsuite is currently broken on Open
Indiana, this the underlying problem:
$ cat test.sh
#! /bin/sh
f ()
{
echo "arguments: $#"
}
f ${1+"$@"}
$ ./test.sh a
arguments: 1
$ ./test.sh a b
arguments: 2
$ ./test.sh a b ""
arguments: 2
$ ./test.sh a b "" ""
arguments: 3
$ ./test.sh a b "" "" d
arguments: 5
$ ./test.sh a b "" "" d ""
arguments: 5
$ ./test.sh a b "" "" d "" ""
arguments: 6
$ /bin/sh --version
version sh (AT&T Research) 93t+ 2010-03-05
The latest *empty* argument is eaten by ${1+"$@"} construct, and I don't
see any work-around (e.g. simlar to what we have for older zsh). The "$@"
works fine there..
I'm not sure here. Is this issue worth documenting in Shellology section
withing autoconf.info? This probably should be fixed somehow in libtool,
but I'm not yet sure what is the proper way.
Pavel
- Shellology: ksh93 from OpenIndiana ${1+"$@"},
Pavel Raiskup <=