Bash 자식스크립트에서 변수 받아오기

1 개요[ | ]

parent.sh
#!/bin/bash
source child.sh
echo foo=[$foo]
echo bar=[$bar]
echo -- parent end...
child.sh
#!/bin/bash
foo=hello
bar=world
echo -- child end...
실행결과
$ ./parent.sh 
-- child end...
foo=[hello]
bar=[world]
-- parent end...

2 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}