While using flags for echo and printf, place the flags before any strings in the command, otherwise Bash will consider the flags as another string.