shell
itw_wang
itwangxw
展开
-
shell中变量和字符串拼接方法
如下示例:#!/bin/bashv1="ll"echo "he${v1}o world!"执行示例结果:hello world!直接拼接就可以,可以不用空格、tab等将变量与字符串隔离开。原创 2019-09-24 15:57:11 · 18639 阅读 · 0 评论 -
shell逐行读取文件的几种方法
方法1:while循环中while read linedo echo $linedone < filename方法2:管道法: cat $filename | while read linecat filename | while read linedo echo $linedone方法3:for循环for line in `cat filena...原创 2019-09-25 13:52:09 · 437 阅读 · 0 评论