"리눅스 set -a"의 두 판 사이의 차이

36번째 줄: 36번째 줄:
* [[리눅스 set]]
* [[리눅스 set]]
* [[리눅스 set -x]]
* [[리눅스 set -x]]
* [[리눅스 set -ax]]
* [[리눅스 export]]
* [[리눅스 export]]
* [[Bash 자식스크립트에서 변수 받아오기]]
* [[Bash 자식스크립트에서 변수 받아오기]]

2018년 11월 15일 (목) 21:50 판

1 개요

리눅스 set -a
  • 생성 또는 변경되는 변수를 export되게 함
parent.sh
#!/bin/bash
set -a
source child1.sh
./child2.sh
child1.sh
#!/bin/bash
foo=hello
bar=world
echo -- child1 end...
child2.sh
#!/bin/bash
echo -- child2 start...
echo foo=[$foo]
echo bar=[$bar]
실행결과
$ ./parent.sh 
-- child1 end...
-- child2 start...
foo=[hello]
bar=[world]

2 같이 보기

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