Pattern: Mismatched printf
arguments
Issue: -
You're using a printf
format string with more %s
variables than arguments to fill them.
Example of incorrect code:
printf "Hello %s, welcome to %s.\n" "$USER"
The last %s
will just become an empty string every time.
Either remove the unused variables from the format string, or add enough arguments to fill them.
Example of correct code:
printf "Hello %s, welcome to %s.\n" "$USER" "$HOSTNAME"