简体   繁体   English

Shell脚本中IFS的多个值

[英]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> . 我正在编写需要具有多个内部字段分隔符值- <newline><tab><.><space>的shell程序。 Is there any way to assign all these to IFS? 有什么办法将所有这些分配给IFS? Also I am not talking about awk here. 我在这里也没有在谈论awk。

In bash you can re-assign those multiple values like this: 在bash中,您可以像这样重新分配这些多个值:

IFS=$'\n\t. '

In other shells you have to do it manually or use other external commands to generate it: 在其他shell中,您必须手动执行操作或使用其他外部命令来生成它:

IFS="
    . "

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM