Skip to content

Files

Latest commit

 

History

History
26 lines (16 loc) · 566 Bytes

SC2298.md

File metadata and controls

26 lines (16 loc) · 566 Bytes

Pattern: Use of invalid ${$x}

Issue: -

Description

ShellCheck found a parameter expansion ${..} where the first element was a second parameter expansion, either ${$x..} or ${${x}..}. This is not valid.

Example of incorrect code:

# Expecting $RETRIES or 3 if unset
retries=${$RETRIES:-3}

The extra $ was unintentional and should simply be deleted.

Example of correct code:

retries=${RETRIES:-3}

Further Reading