$ printf \'apple\' | wc -m 5 $ echo \'apple\' | wc -m 6
Why printf prints 5 and echo prints 6 characters?
Here is the difference ..
$printf 'abcd' abcd$ echo 'abcd' abcd $
As you can see the additional char is newline \n
\n