Opened 17 years ago
Closed 17 years ago
#1773 closed bug (fixed)
$0 is set incorrectly
Reported by: | andreasf | Owned by: | axeld |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | System | Version: | R1/pre-alpha1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
$0 should contain the (relative) path to the executable, not the command used to call it.
The following test script:
#!/bin/sh echo $0
called with test.sh
prints ./test.sh
on BeOS but test.sh
on Haiku.
This seems to keep aclocal et al. from working, since $0 returns aclocal
but the path to call itself is e.g. config/bin/aclocal
.
Change History (4)
follow-up: 3 comment:1 by , 17 years ago
comment:2 by , 17 years ago
comment:3 by , 17 years ago
Replying to korli:
Just tried, and it correctly outputs ./test.sh on Haiku.
Make sure you don't call it as ./test.sh
, then obviously it outputs ./test.sh
. ;)
comment:4 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Applied patch from kaliber in hrev24131. Tested OK.
Note:
See TracTickets
for help on using tickets.
Just tried, and it correctly outputs ./test.sh on Haiku. Could you check ?