Skip to content

A question about bash pipe(|)  #72

Description

@peiqingyu

I have an input file which is untagged and its content is ascii characters "abc".

$ echo abc >input
$ chtag -r input
$ chtag -p input
 - untagged    T=off input

And I have a Go program named main which reads data from stdin and prints the data in hex.
$ cat input | main
input is: 2fefbfbdc48e

I expected got "6162630a" which is "abc\n" in hex. It seems bash does a conversation from 819 to 1047. On my test system, _BPXK_AUTOCVT is set to "On". I am confused about the behavior. Any thought?
If the input file is tagged with 819 I got the expected output.
$ chtag -p input
6162630a

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions