码迷,mamicode.com
首页 > 系统相关 > 详细

shell 父子传值

时间:2017-07-10 12:03:26      阅读:187      评论:0      收藏:0      [点我收藏+]

标签:read   str   bsp   alt   bin   dex   string   class   ring   

通过一个中间文件进行:

 

#!/bin/bash
 
(
 subvar="hello shell"
 echo "$subvar" > temp.txt
)
 
read pvar < temp.txt
 
echo $pvar

shell 父子传值

标签:read   str   bsp   alt   bin   dex   string   class   ring   

原文地址:http://www.cnblogs.com/kakaisgood/p/7144917.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!