Bourne Shell bug?

utzoo!decvax!ittvax!qumix!msc utzoo!decvax!ittvax!qumix!msc
Fri May 7 15:09:44 AEST 1982


	Doing the following on my 4.1bsd system caused strange things to
	happen.

	1)	Create a shell script "test" containing
			#! /bin/sh
			echo [$1] [$2] [$3] [$4]

	2)	Create a file "test.tmp" containing
			"-a" "-o 0.5" ""
	
	3)	Give the command
			test "-a" "-o 0.5" ""
		This results in the output
			[-a] [-o 0.5] [] []
		which is as expected.
	
	4)	Give the command
			cat test.tmp
		which gives the expected output
			"-a" "-o 0.5" ""

	5)	Give the command
			test `cat test.tmp`
		which should give the same result as 3 since test.tmp
		contains the same text as the command tail used in 3.
		Instead the output is
			["-a"] ["-o] [0.5"] [""]

	Notice how the "-o 0.5" argument has been split into two arguments
	somewhere along the way.  Also notice that the quotation marks have
	not been stripped off.  I would appreciate a fix or some way
	to get around the problem.

	Mark Callow
	Qume Corp.
	{decvax!}ittvax!qumix!msc



More information about the Comp.bugs.4bsd.ucb-fixes mailing list