Skip to content

Simplify variable creation? #6

@rasa

Description

@rasa
declare SCRIPT_PATH
# shellcheck disable=SC2034
SCRIPT_PATH="${SCRIPT_PATH:-$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)}"

can be simplified to

:${SCRIPT_PATH:=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)}"

per http://mywiki.wooledge.org/BashSheet#Parameter_Operations

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions