close #498 tbg bug (tap replace)

- close issue #498
- add flag to bash command read to read data in raw mode