[
https://issues.apache.org/jira/browse/RATIS-1340?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Attila Doroszlai resolved RATIS-1340.
-------------------------------------
Fix Version/s: 3.0.0
Resolution: Fixed
> Ratis scripts' discovery of Bash source path is incompatible with CDPATH.
> -------------------------------------------------------------------------
>
> Key: RATIS-1340
> URL: https://issues.apache.org/jira/browse/RATIS-1340
> Project: Ratis
> Issue Type: Bug
> Components: documentation, examples, website
> Reporter: Chris Nauroth
> Assignee: Chris Nauroth
> Priority: Minor
> Fix For: 3.0.0
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> Several Bash scripts in Ratis use this common idiom to discover the current
> source path and then build relative paths from it:
> {code}
> DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
> {code}
> This mostly works well, but it isn't compatible with interactive shells using
> the {{CDPATH}} environment variable to provide a custom search path for
> resolving the directory referenced by {{cd}}. (See [bash man
> page|https://linux.die.net/man/1/bash] discussion of "CDPATH" and how the
> resolved directory is "written to the standard output.")
> The standard solution is to redirect stdout of {{cd}} to {{/dev/null}}:
> {code}
> DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )"
> {code}
> Some Ratis scripts already do this, but not all.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)