x=`gcc -print-prog-name=ld`
y=ld
echo $x
echo $y
if test $x = $y; then
echo equal
else
echo not equal
fi
gives me this result
$ ./test.sh
ld
ld
not equal
I'm deseperate :-(
Update: I've fixed it now, it was a hack i did to colorgcc to make it work with unsermake that was making gcc return "strange" things. Thanks to all that ofered help both here and in #kde-devel
4 comments:
has probao con == o con -eq , e incluso con "x$x" == "x$y"?
y a encerrarlos entre corchetes ?
saludos
Works perfectly fine here.
sh -x ./test.sh
++ gcc -print-prog-name=ld
+ x=ld
+ y=ld
+ echo ld
ld
+ echo ld
ld
+ test ld = ld
+ echo equal
equal
You may want to check the values for extra whitespace:
echo \"$x\"
echo \"$y\"
tried it with bash and dash - both work fine.
what version of bash do you use?
Post a Comment