Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #11722

The <newline> character can also be an "IFS whitespace character"

From ziyunfei <446240525@qq.com>
Newsgroups gnu.bash.bug
Subject The <newline> character can also be an "IFS whitespace character"
Date 2015-10-20 22:21 +0800
Message-ID <mailman.686.1445350913.7904.bug-bash@gnu.org> (permalink)

Show all headers | View raw


Quoting from the bash manual: 

"If IFS has a value other than the default, then sequences of the whitespace characters *space and tab* are ignored at the beginning and end of the word, as long as the whitespace character is in the value of IFS (an IFS whitespace character)."

If this is true, then the following script

$ IFS=$'\n'
$ a=$'\n1\n2\n'
$ printf "%s\n" $a
1
2

should print <> <1> <2> 3 fields, but it doesn't.

So I guess *space and tab* should be replace by *space, tab and newline* in that section.

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

The <newline> character can also be an "IFS whitespace character" ziyunfei <446240525@qq.com> - 2015-10-20 22:21 +0800

csiph-web