Hotplug needs the "which" program

Bryan Kadzban bryan at kadzban.is-a-geek.net
Thu May 13 09:48:27 PDT 2004


On Thu, May 13, 2004 at 04:33:43PM +0200, Matthias Benkmann wrote:
> The which script should be
> 
> #!/bin/bash
> type -pa "$@" | head -n 1 ; exit ${PIPESTATUS[0]}
> 
> 
> or you won't get the correct exit code.
>

Why not just:

#!/bin/bash
type -p "$@"

?

type -pa won't search the hash table, but since this script gets
executed in a new shell anyway, the hash table isn't populated.  At
least, I don't think it is...



More information about the lfs-dev mailing list