[ 
https://issues.apache.org/jira/browse/RATIS-1340?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tsz-wo Sze updated RATIS-1340:
------------------------------
    Fix Version/s: 2.4.1

> 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, 2.4.1
>
>          Time Spent: 40m
>  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)

Reply via email to