[root@localhost ~]# x_mm="yyy" [root@localhost ~]# s=x [root@localhost ~]# cat test.txt alt="yyy/20150823020537310.jpg" src= asdasd asdasdasdasd cvdawsdas [root@localhost ~]# sed -i s"#$(eval echo $`echo $s`_mm)#xxx#"g test.txt [root@localhost ~]# cat test.txt alt="xxx/20150823020537310.jpg" src= asdasd asdasdasdasd cvdawsdas
使用eval用变量的值作为新的变量名
猜你喜欢
转载自886.iteye.com/blog/2361020
今日推荐
周排行