Shell

Shell

Made by DeepSource

Consider escaping $ to make it a literal SH-1135

Anti-pattern
Major

The script appears to be closing a double quoted string for the sole purpose of making a dollar sign $ literal. This will work, but a better way is to escape it with a backslash. This allows the double quoted string to continue uninterrupted, thereby reducing the visual noise of stopping and starting quotes in the middle of a shell word.

Problematic code:

echo "The apples are $""1 each"
eval "var=$"name

Preferred code:

echo "The apples are \$1 each"
eval "var=\$name"

# or

var="${!name}"