shell $'somestring'
2013-12-01 11:10
246 查看
IFS默认支持 空格 tab 换行符
改变 IFS
IFS=$'\n'
IFS='\n'
IFS=\n
Normally
改变 IFS
IFS=$'\n'
IFS='\n'
IFS=\n
Normally
bashdoesn't interpret escape sequences in string literals. So if you write
\nor
"\n"or
'\n', that's not a linebreak - it's the letter
n(in the first case) or a backslash followed by the letter
n(in the other two cases).
$'somestring'is a syntax for string literals with escape sequences. So unlike
'\n',
$'\n'actually is a linebreak.
相关文章推荐
- shell脚本--常用知识
- shell脚本读取文件
- shell脚本--if判断(数字条件、字符串条件)
- Shell脚本 字符串大小比较 字符串是否相等比较 字符串是否为空判断
- shell编程技巧和陷阱
- SQL注入中利用XP_cmdshell提权的用法(转)
- 收藏Shell学习网页
- [Linux Shell] 尽量在Linux下直接编写sh脚本
- shell 字符串截取
- [SHELL] LAMP一键安装脚本设计(v2.1)
- 解决部分linux下不能shell脚本失效的解决办法 : not found Bad for loop variable
- Linux Shell笔记之正则表达式
- linux shell编程指南第十一章------------合并与分割1
- linux shell bash 内置变量参考
- linux shell编程指南第十一章------------合并与分割
- shell脚本 批量转换目录下文件编码
- Shell小技巧:删除文件中重复的行
- linux shell编程指南第十章------sed 用法介绍1
- 用于检测进程的shell脚本代码小结
- 用于检测进程的shell脚本代码小结