Ticket #2130 (closed bug: fixed)

Opened 3 weeks ago

Last modified 2 weeks ago

[which] behaves unexpected

Reported by: andreasf Assigned to: axeld
Priority: normal Milestone: R1
Component: Applications/Command Line Tools Version: R1 development
Cc: Platform: x86

Description

The exit code of which is not inline with the expectations of some ./autogen.sh and similar scripts.

which someexistingtool || echo "You need someexitingtool >= 0.2"

is expected to print the message iff someexistingtool is not found. On Haiku it is sometimes inversed.

Change History

04/25/08 19:50:42 changed by bonefish

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in r25169.

04/26/08 12:02:18 changed by andreasf

  • status changed from closed to reopened.
  • resolution deleted.

Not quite fixed yet...

When running from the Terminal it appears to work as expected now, but not from inside a script:

cat test-which.sh:

#!/bin/sh
which gcc || echo $?

which gcc || echo $?:

/boot/develop/tools/gnupro/bin/gcc

./test-which.sh:

./test-which.sh: line 2: which: command not found
127

04/26/08 12:43:24 changed by bonefish

  • status changed from reopened to closed.
  • resolution set to fixed.

Fixed in r25190.