Created
January 27, 2019 10:34
-
-
Save rocknr011/85d0029cdd7c0c7076318045a419b5aa to your computer and use it in GitHub Desktop.
How pipe tail -f to iconv command (inspired by https://stackoverflow.com/questions/50231194/how-to-pipe-tail-f-to-iconv-cmmand)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #iconv.sh | |
| FROM_CP=${1:-"cp1251"} | |
| TO_CP=${2:-"utf-8"} | |
| while read line | |
| do | |
| echo "$line" | iconv -f $FROM_CP -t $TO_CP | |
| done < "${1:-/dev/stdin}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment