1 |
On 1/26/06, Robert Persson <ireneshusband@××××××××.uk> wrote: |
2 |
> Someone was kind enough to send me a script that calls /usr/bin/test. When the |
3 |
> script didn't work I realised that test was behaving strangely. Basically it |
4 |
> doesn't seem to return anything. |
5 |
|
6 |
test doesn't output anything...it indicates success/failure with the |
7 |
exit code. Try the following test.sh script: |
8 |
|
9 |
#!/bin/bash |
10 |
/usr/bin/test "$@" |
11 |
rc=$? |
12 |
if test "$rc" -eq 0; then |
13 |
echo "'test $@' was successful" |
14 |
else |
15 |
echo "'test $@' failed with code $rc" |
16 |
fi |
17 |
|
18 |
As others have said though, watch out for the 'test' command built-in |
19 |
to many shells, as the behavior there is defined by the shell. |
20 |
Generally though, /usr/bin/test and bash test should work the same.... |
21 |
|
22 |
-Richard |
23 |
|
24 |
-- |
25 |
gentoo-user@g.o mailing list |