I tought these command were equivalent in bash, but they are producing different outputs. Could you help me understand why?
$ echo "SEBA" | wc
1 1 5
$ wc <<< "SEBA"
1 1 5
Running on
- Ubuntu 20.04.2 LTS
- GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu)
- wc (GNU coreutils) 8.30
here are some tests:
$ echo "SEBA" | wc | hexdump
0000000 2020 2020 2020 2031 2020 2020 2020 2031
0000010 2020 2020 2020 0a35
0000018
$ wc <<< "SEBA" | hexdump
0000000 2031 2031 0a35
0000006
$ echo "SEBA" | hexdump
0000000 4553 4142 000a
0000005
$ hexdump <<< "SEBA"
0000000 4553 4142 000a
0000005