bugThe GNU Bourne-Again SHell - Bugs: bug #67410, Bash read fails on UTF-8

 
 

bug #67410: Bash read fails on UTF-8

Submitter:  None
Submitted:  Fri 08 Aug 2025 11:39:12 AM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Invalid Privacy:  Public
Assigned to:  None Open/Closed:  Open
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

Fri 08 Aug 2025 12:50:47 PM UTC, comment #1: 

This is not a bug. You have set IFS to two characters: '\' and 'n'. Since $IFS contains 'n', it delimits the first and only field, which is assigned to `detail'.

If you want to set IFS to a newline, use

IFS=$'\n'


Chet Ramey <chet>
Group administrator
Fri 08 Aug 2025 11:39:12 AM UTC, original submission:  

I used the following command in the bash of the docker image "amd64/bash:devel" to reproduce the behaviour:


bash-5.3# IFS='\n' read -r detail < <(echo "schön") ; echo "${detail}"
schö
bash-5.3#


I'm expecting to see the whole word to be read but the last letter disappeared. It seems to be related to the IFS (here newline).
However, other combinations work:


bash-5.3# IFS='\n' read -r detail < <(echo "schönwässerle") ; echo "${detail}"
schönwässerle
bash-5.3#


Anonymous

 

Attached Files

This item currently has no attached files.

(Note: upload size limit is set to 4.0MiB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

Carbon-Copy List
  • -email is unavailable- added by chet (Posted a comment)
  •  

    Votes

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

    History

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2025-08-08 chet StatusNone Invalid

    Back to the top

    Powered by Savane 3.16-598c.
    Corresponding source code