ScPup64: read ignores $IFS

Moderators: peebee, Forum moderators

Post Reply
HerrBert
Posts: 329
Joined: Mon Jul 13, 2020 6:14 pm
Location: Germany, NRW
Has thanked: 17 times
Been thanked: 110 times

ScPup64: read ignores $IFS

Post by HerrBert »

Hello.

When writing a script in ScPup64 it happend to me that the read command ignores the linefeed in $IFS.
Script and discussion about it can be found here: viewtopic.php?p=15689#p15689

I have repeated the very trivial test in the recent ScPup64-21.01:

Code: Select all

# set | grep IFS
IFS=$' \t\n'
# read A B <<<`echo -e "eins zwei"`
# echo $A $B
eins zwei
# read A B <<<`echo -e "eins\nzwei"`
# echo $A $B
eins
# echo -e "eins\nzwei"
eins
zwei
# read -d "\n" A B <<<`echo -e "eins\nzwei"`
# echo $A $B
eins zwei
# 

bash versions are:

  • ScPup64-20.06+2-T:
    # bash --version
    GNU bash, version 5.0.18(1)-release (x86_64-slackware-linux-gnu)
    Copyright (C) 2019 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

    This is free software; you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    #

  • ScPup64-21.01:
    # bash --version
    GNU bash, version 5.1.4(1)-release (x86_64-slackware-linux-gnu)
    Copyright (C) 2020 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

    This is free software; you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    #

As read is a shell builtin command there may be other commands affected.

ozsouth
Posts: 1358
Joined: Sun Jul 12, 2020 2:38 am
Location: S.E. Australia
Has thanked: 210 times
Been thanked: 601 times

Re: ScPup64: read ignores $IFS

Post by ozsouth »

@HerrBert - confirmed in ScPup64-20.06+2. OK in ScPup64-20.06+0 - bash 5.0.17(1).

some1
Posts: 70
Joined: Wed Aug 19, 2020 4:32 am
Has thanked: 17 times
Been thanked: 11 times

Re: ScPup64: read ignores $IFS

Post by some1 »

So does FossaPup64
bash 5.0.17(1)

Thanks HerrBert.
--
I could not find any mention of the bug on the net/over at GNU.

Post Reply

Return to “SPups”