0

Hi IFS=' ' is for space, but what is

IFS='
'
jeevanreddymandali
  • 395
  • 3
  • 8
  • 23
  • @musefan hi are you telling me or asking me ? – jeevanreddymandali Jul 14 '15 at 13:35
  • I had a feeling you were going to say that... I am guessing, as it seems logical. I would have though you were in some sort of position to be able to validate that. By the definition of IFS surely it would mean that unescaped substitutions would be split into words using a newline rather than a space. You might want to consider modifying your question to include some context. Where have you seen it like this for example – musefan Jul 14 '15 at 13:45
  • i saw in internet today somewhere brother but cannot fin it again :( is there anything like that? – jeevanreddymandali Jul 14 '15 at 14:05

1 Answers1

1

It means you are specifying the IFS to use newline for splitting. This would be similar to doing:

IFS=$'\n'

The difference being is that your way is POSIX compliant.

My sources for this answer are here and here

You may find that the different methods are preferred depending on which shell implementation you are using (I think that's the right term?)


NOTE: My answer is based purely on the last 10 minutes of research, I have no prior experience or knowledge with this.

Community
  • 1
  • 1
musefan
  • 47,875
  • 21
  • 135
  • 185