z/OS Tools & Language

Expand all | Collapse all

Bash: iconv makes shell unusable

  • 1.  Bash: iconv makes shell unusable

    Posted 04-01-2019 13:51

    From a Z/OS prompt, if I start bash, then use iconv to show an ASCII file, the whole bash shell becomes corrupted:

     bash-4.3$ iconv -f 1047 -t 819 test.txt
     ŽÂ/ËÇ”“„€
    

    The ascii/ebcdic gibberish is then echoed, ^d or exit does not terminate the shell.

    This behavior does not happen with sh or tcsh. Note the same behavior happens with other code pages.



  • 2.  RE: Bash: iconv makes shell unusable

    Posted 04-02-2019 05:43

    Hi,
    we know, that this usage of iconv breaks bash. However, in my opinion this command is meaningless. If you need to read a file, you should tag it with command:
    chtag -tc 819 < file > #For ASCII file
    chtag -tc 1047 < file > #For EBCDIC file
    Then you can read it with command “cat < file >”.
    If you want to change encoding of the file, you need to use redirection: iconv -f 1047 -t 819 test.txt > test1.txt

    Thanks,
    Tatiana



  • 3.  RE: Bash: iconv makes shell unusable

    Posted 04-08-2019 03:27

    I do not agree that iconv is per se meaningless because of using bash although I agree that there are many situations where indeed chtag is the better choice.

    Funny: when I run iconv in a shell I get a corrupted prompt but the bash is still usable. Means: I press ENTER and then the prompt is ok. And of course I can enter commands aso.



  • 4.  RE: Bash: iconv makes shell unusable

    Posted 05-20-2020 04:41

    This is from last year.

    One addition: When I type cksum command and then Ctrl-C then the bash is unusable. Nothing helps, I have to kill my ssh session from the outside.

    If this is a bug in bash do you plan to fix it?



  • 5.  RE: Bash: iconv makes shell unusable

    Posted 05-25-2020 07:45

    Hello Manfred,

    Thanks for reporting this. We’re going to review bash code in future and check what’s causing the issue.

    Thanks,
    Vladimir



  • 6.  RE: Bash: iconv makes shell unusable

    Posted 05-26-2020 01:47

    Hi Vladimir, thanks for looking into this.



  • 7.  RE: Bash: iconv makes shell unusable

    Posted 05-26-2020 04:31

    I should add that it is important for me to understand if this is a problem in the bash shell or not.

    If it isn’t then I would pursue things (regarding cksum behavior) with IBM.



  • 8.  RE: Bash: iconv makes shell unusable

    Posted 05-27-2020 00:56

    Hi Manfred,

    We suspect it might be a bash issue but we don’t know for sure at the moment. We need to research this first quite a bit.

    Regards,
    Vladimir



  • 9.  RE: Bash: iconv makes shell unusable

    Posted 06-03-2020 14:29

    Hi Vlad, thanks for the status.