Opened 12 years ago

Closed 12 years ago

#2130 closed bug (fixed)

[which] behaves unexpected

Reported by: andreasf Owned by: axeld
Priority: normal Milestone: R1
Component: Applications/Command Line Tools Version: R1/pre-alpha1
Keywords: Cc:
Blocked By: Blocking:
Platform: x86


The exit code of which is not inline with the expectations of some ./ 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 (3)

comment:1 by bonefish, 12 years ago

Resolution: fixed
Status: newclosed

Fixed in hrev25169.

comment:2 by andreasf, 12 years ago

Resolution: fixed
Status: closedreopened

Not quite fixed yet...

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


which gcc || echo $?

which gcc || echo $?:



./ line 2: which: command not found

comment:3 by bonefish, 12 years ago

Resolution: fixed
Status: reopenedclosed

Fixed in hrev25190.

Note: See TracTickets for help on using tickets.