"Bash 자식스크립트에 변수 전달하기"의 두 판 사이의 차이

27번째 줄: 27번째 줄:
* [[리눅스 export]]
* [[리눅스 export]]
* [[Bash 자식스크립트에서 변수 받아오기]]
* [[Bash 자식스크립트에서 변수 받아오기]]
* [[Bash 자식스크립트에서 변수 받아와서 다른 자식스크립트에 변수 전달하기]]


[[분류: Bash]]
[[분류: Bash]]

2018년 11월 15일 (목) 01:06 판

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 }}