Re: Package maintainer script policy.
Hi,
This just goes to prove even Debian developers may not be up
to the task of passing all commandline arguments to a binary in a
shell script. So, if one can write a C program that handles the task,
it should be valid to have that called directly in a postinst, rather
than mess up writing a shell script to call it indirectly (and not
pass the arguments correctly).
>>"Raul" == Raul Miller <rdm@test.legislate.com> writes:
Raul> Manoj Srivastava <srivasta@datasync.com> wrote:
>> Well, if $@ is empty, "$@" expands to "";
Raul> Is this mandated by the posix standard? If so, this is an example of
Raul> how debian's current /bin/sh is not posix. If not, then this is
Raul> just plain bogus.
Oh, bosh. Pardon me, but in this case you do not know what you
are talking about. *Of Course* it is mandated by POSIX, and has been
implemented by ever darned ash/ksh/zsh/bash since the dawn of the
epoch. I fail to see how you could have come across different
behaviour, but then, there may be shells badly broken out
there. Thank the lord for Bash.
I shall not bandy words with you. Here are scripts. Run them
on your shell, if the behaviour is different, file a bug for your
shell. Bash passes with flying colors.
Note: Basic shell expansion
______________________________________________________________________
__> unset nosuch
__> if [ "X$nosuch" = "X" ]; then echo "Same" ; fi
Same
__> if [ "$nosuch" = "" ]; then echo "Same" ; fi
Same
__> if [ $nosuch = "" ]; then echo "Same" ; fi
[: =: unary operator expected
______________________________________________________________________
See? $nosuch and "$nosuch" are not the same thing. Never have
been. To drive the point home, try this little shell function that
reports the number of positional arguments and the values.
______________________________________________________________________
__> tfunc () { echo "$# -- $@" ; }
__> tfunc a
1 -- a
__> tfunc ""
1 --
__> tfunc a b c d
4 -- a b c d
__> tfunc $a
0 --
__> tfunc "$a"
1 --
______________________________________________________________________
manoj
amazed Raul, of all people, had to have this pointed out to him.
--
Life is a process, not a principle, a mystery to be lived, not a
problem to be solved. Gerard Straub, television producer and author
(stolen from Frank Herbert??)
Manoj Srivastava <srivasta@acm.org> <http://www.datasync.com/%7Esrivasta/>
Key C7261095 fingerprint = CB D9 F4 12 68 07 E4 05 CC 2D 27 12 1D F5 E8 6E
--
Unsubscribe? mail -s unsubscribe debian-user-request@lists.debian.org < /dev/null
Reply to: