Bash 자식스크립트에 변수 전달하기

1 개요[ | ]

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

2 같이 보기[ | ]

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