[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 'hash foo' may fail, and would require something like 'hash /usr/bin

From: Chet Ramey
Subject: Re: 'hash foo' may fail, and would require something like 'hash /usr/bin/foo'
Date: Tue, 22 Feb 2022 11:44:45 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.1

On 2/22/22 10:10 AM, Benoit Lacelle wrote:

> Bash Version: 5.1
> Patch Level: 16
> Release Status: relase
> Bash version: 5.1.16(1)-release (x86_64-alpine-linux-musl)
> Description:
> Issue discussed at https://github.com/disney/meteor-base/pull/102
> Supposedly related with Bash5.1, 'hash npm' now fails in very recent bash,
> but not in local macos bash, nor older linux docker images bashes

What does `fail' mean here? Does it give an error message? The only ways
hash can fail are if it doesn't find the given name in $PATH or if the
given name, while found in $PATH, is not an executable file.

> Fix:
> 1- Rely on sh instead of bash for given docker image

> 2- Update our script from 'hash npm' to 'hash /usr/bin/npm'

What is that expected to do? It certainly won't put `npm' into the hash
table. You probably want `hash -p /usr/bin/npm npm' instead.

``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]