Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!houxm!houxz!vax135!cornell!uw-beaver!tektronix!hplabs!sri-unix!cosell@BBN-LABS-B.ARPA From: cosell@BBN-LABS-B.ARPA Newsgroups: net.unix-wizards Subject: Bug in the Bourne shell Message-ID: <1671@sri-arpa.UUCP> Date: Fri, 6-Jul-84 09:32:27 EDT Article-I.D.: sri-arpa.1671 Posted: Fri Jul 6 09:32:27 1984 Date-Received: Mon, 9-Jul-84 00:39:55 EDT Lines: 17 From: Bernie Cosell AFter struggling some in trying to debug a shell script, I discovered that the source of my trouble was what seems to be a bug in the Bourne shell. Both our 4.2 and our V7 Bourne shells act the same way: The problem is with '"$@"'. This construct is claimed to expand to '"$1" "$2" ... "$n"'. Unfortunately, it seems just to throw away null args. That is, if your args are, say, "a", "b c ", and "d", then, as I would have expected, when I do 'nextprogram "$@"', nextprogram correctly is fed three args, the second of which is "b c ". Just right.... BUT... if your args are "a", "", and "d", then when you do 'nextprogram "$@"', nextprogram ends up with only TWO args - the "a" and the "d", with the null arg just gone. Thanks /Bernie cosell@bbn-unix