Date: Thu, 3 Sep 2009 13:50:18 +0200 From: Bertram Scharpf <lists@bertram-scharpf.de> To: freebsd-questions@freebsd.org Subject: Re: Why /bin/sh doesn't like the line: if test "x$my_var" == "xyes"; then Message-ID: <20090903115018.GA21032@marge.bs.l> In-Reply-To: <423199.64505.qm@web110716.mail.gq1.yahoo.com> References: <423199.64505.qm@web110716.mail.gq1.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi, Am Donnerstag, 03. Sep 2009, 04:14:56 +0000 schrieb jerry M: > configure file got this line and it causes the message: test: > xyes: unexpected operator But removing spaces around == or > replacing == with = makes it to work. > > On Linux though this line works fine. As `man test' describes, the /bin/test executable does not recognize a == operator. Neither in `sh' nor in `bash' the `test' executable will be called (unless written as /bin/test). In both cases it is a builtin command. The Sh builtin works like the `test' executable; the Bash builtin recognizes ==. Bertram -- Bertram Scharpf Stuttgart, Deutschland/Germany http://www.bertram-scharpf.de
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090903115018.GA21032>