SC2225 – ShellCheck Wiki

See this page on GitHub

Sitemap


This cp has no destination. Check the arguments.

Problematic code:

cp "$file $dir"

Correct code:

cp "$file" "$dir"

Rationale:

ShellCheck found a cp command with a single parameter. This may be because the source and destination was accidentally merged into a single argument, or because the line was broken in an invalid way.

Fix the cp statement by correctly specifying both source and destination.

Exceptions:

None


ShellCheck is a static analysis tool for shell scripts. This page is part of its documentation.