Gentoo Archives: gentoo-user

From: Richard Fish <bigfish@××××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] /usr/bin/test doesn't seem to do anything
Date: Fri, 27 Jan 2006 00:29:47
Message-Id: 7573e9640601261622n71053bf7p2db8f89f5ca0c398@mail.gmail.com
In Reply to: [gentoo-user] /usr/bin/test doesn't seem to do anything by Robert Persson
On 1/26/06, Robert Persson <ireneshusband@××××××××.uk> wrote:
> Someone was kind enough to send me a script that calls /usr/bin/test. When the > script didn't work I realised that test was behaving strangely. Basically it > doesn't seem to return anything.
test doesn't output anything...it indicates success/failure with the exit code. Try the following test.sh script: #!/bin/bash /usr/bin/test "$@" rc=$? if test "$rc" -eq 0; then echo "'test $@' was successful" else echo "'test $@' failed with code $rc" fi As others have said though, watch out for the 'test' command built-in to many shells, as the behavior there is defined by the shell. Generally though, /usr/bin/test and bash test should work the same.... -Richard -- gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] /usr/bin/test doesn't seem to do anything Robert Persson <ireneshusband@××××××××.uk>