ranger
ranger

Reputation: 301

Multiple values for IFS in shell scripting

I am coding a shell program which needs to have multiple internal field separator values - <newline><tab><.><space>. Is there any way to assign all these to IFS? Also I am not talking about awk here.

Upvotes: 1

Views: 2309

Answers (1)

konsolebox
konsolebox

Reputation: 75488

In bash you can re-assign those multiple values like this:

IFS=$'\n\t. '

In other shells you have to do it manually or use other external commands to generate it:

IFS="
    . "

Upvotes: 4

Related Questions