On 2021-08-10, Paul Eggert wrote:
> Here is a shell transcript on my platform. Can you compare it to what
> happens on your platform? I am guessing that the first 'echo $?'
> outputs something different but would like to know what it is. Plus
> any other differences.
> 
> $ export LC_ALL=en_US.UTF-8
> $ s_pair=$(printf '\360\220\220\205')
> $ printf '%s\n' "$s_pair" > in
> $ src/grep --file=in in >out
> $ echo $?
> 0
> $ od -t o1 in
> 0000000 360 220 220 205 012
> 0000005
> $ cmp in out
> $ echo $?
> 0

This is a pretty drastic difference.  I don't think I missed
anything, though.

$ export LC_ALL=en_US.UTF-8
$ s_pair=$(printf '\360\220\220\205')
$ printf '%s\n' "$s_pair" > in
$ src/grep --file=in in >out
$ echo $?
1
$ od -t o1 in
0000000 360 220 220 205 012
0000005
$ cmp in out
cmp: EOF on out which is empty
$ echo $?
1

Regards,
Gary




Reply via email to