Comments (2)
Bash is compiled as an ASCII program, so in order to work with ebcdic files, you need to tag it appropriately.
If you tag your file as EBCDIC, using chtag -tc 1047 input
do you get the expected result?
The other option is to set this environment variable:
export __UNTAGGED_READ_MODE=ASCII
always convert data from CCSID 1047 to CCSID 819
from bashport.
The input is an ASCII file which is untagged and I expect to get its ASCII content in my Go program. In our actual case, the input file is a tarball and it is untagged. I expect the Go program to read the tarball in stdin and then extract the content correctly. I tested the following scenarios with bash:
$ cat tarball | go-program --- doesn't work
$ go-program < <(cat tarball) --- doesn't work
$ go-program <tarball --- works well
Only the third redirection method works for my case. Why the other two methods do not work? Is it possible to make them work? It seems the tarball is converted from 1047 to 819 by bash for the first two methods. Thanks.
from bashport.
Related Issues (20)
- #! used with script as command does not work.
- performance issues HOT 12
- guidance on shells HOT 10
- download failure HOT 5
- Investigate HAVE_HASH_BANG_EXEC induced git bug
- bash raises protection exception in Jenkins groovy environment
- Process substitution with bash 5.2.0 (Build 551) HOT 7
- netstat not found from the bash shell HOT 2
- awk issue under zot bash HOT 1
- ctrl+arrow isn't handled HOT 1
- upgrade to at least 5.2.15 HOT 1
- bash "type ping" is not able to point to external link ping command. HOT 1
- how to work with existing rocket env vars for bash HOT 2
- Wait command different behavior in bash
- Process substitution issues when using /dev/fd HOT 3
- Remove setting _CEE_RUNOPTS, _TAG_REDIR_IN etc from .env
- Bash does not source users bashrc file when started by non-interactive ssh command
- Bash garbling output after stderr to stdout redirection and then piping to tee
- A question about bash pipe(|) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bashport.