linux学习笔记总结
2013-08-20 09:23
323 查看
for读取列表中复杂值:
for test in I don't konw if this'll work
do .......
shell会把列表中的单引号尝试使用他们来一定一个单独的数据
两种办法解决:1)使用转义字符(\反斜线)来将单引号转义
2)使用双引号来定义用到的单引号
for test in I don\'t know if "this'll" work
for命令用空格来划分列表中的每个值,如果在单独的数据表中有空格,那么必须用双引号将这些值圈起来
for还可以从变量读取列表
list="ahgoi aohgihao ahoghosi hoiahgoia oahgoia "
list=$list"hello world"
for test in $list
do
echo ....................
done
for 从命令读取值
fiel ="states"
dor state in 'cat $fiel'
for test in I don't konw if this'll work
do .......
shell会把列表中的单引号尝试使用他们来一定一个单独的数据
两种办法解决:1)使用转义字符(\反斜线)来将单引号转义
2)使用双引号来定义用到的单引号
for test in I don\'t know if "this'll" work
for命令用空格来划分列表中的每个值,如果在单独的数据表中有空格,那么必须用双引号将这些值圈起来
for还可以从变量读取列表
list="ahgoi aohgihao ahoghosi hoiahgoia oahgoia "
list=$list"hello world"
for test in $list
do
echo ....................
done
for 从命令读取值
fiel ="states"
dor state in 'cat $fiel'
相关文章推荐
- Linux学习笔记(观看韩顺平老师Linux视频的总结)
- Linux运维学习笔记-定时任务知识总结
- Linux学习笔记之命令总结
- 薛开宇学习笔记二之总结笔记(用一个预训练模型提取特征)--Linux语法总结
- Linux学习笔记总结
- 【linux学习笔记】awk用法总结
- Linux运维学习笔记-目录知识点总结
- 【linux gcc】gcc编译器相关(7月6日学习总结)_学习笔记_003
- Linux学习笔记(知识点总结)
- Linux运维学习笔记-文件系统知识体系总结
- 【linux学习笔记】top命令总结
- Linux学习笔记总结
- 【学习笔记】Linux的命令总结(三)
- 薛开宇学习笔记一之总结笔记(CIFAR-10 在 在 caffe 上进行训练与学习)--Linux语法总结
- 马哥linux学习笔记:locate,find命令总结
- 学习笔记 (Linux和mysql的一些命令和总结) [第十课]
- Linux学习笔记:常用命令总结
- [实习笔记]Linux学习总结------非正式版
- linux学习笔记--总结
- Linux运维学习笔记-软硬链接知识总结