rmyorston / busybox-w32

WIN32 native port of BusyBox.
https://frippery.org/busybox
Other
670 stars 124 forks source link

Duplicate with which -a #427

Closed ale5000-git closed 1 month ago

ale5000-git commented 1 month ago

In bash online this only return unique values:

PATH="${PATH}:/usr/bin/find:/bin/find:/usr/bin/find:/bin/find"
which -a find

Instead on BusyBox for Windows this will return duplicates:

PATH="${PATH};C:/Windows/system32;C:/Windows/system32"
which -a find
avih commented 1 month ago

In bash online this only return unique values:

PATH="${PATH}:/usr/bin/find:/bin/find:/usr/bin/find:/bin/find"
which -a find

It returns a single value because you're adding file names instead of directories.

Try this instead, just duplicate the path, e.g. on ubuntu in bash:

$ PATH=$PATH:$PATH which -a find
/usr/bin/find
/bin/find
/usr/bin/find
/bin/find

So it looks to me that busybox-w32 behaves like bash.

ale5000-git commented 1 month ago

Damn, this happen when copy-pasting in hurry. Sorry and thanks.