Page 1 of 1

ScPup64: read ignores $IFS

Posted: Sat Jan 23, 2021 10:55 am
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.


Re: ScPup64: read ignores $IFS

Posted: Sat Jan 23, 2021 11:17 am
by ozsouth

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


Re: ScPup64: read ignores $IFS

Posted: Thu Feb 04, 2021 10:09 pm
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.