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

잔글 (봇: 자동으로 텍스트 교체 (-source +syntaxhighlight))
 
(다른 사용자 한 명의 중간 판 하나는 보이지 않습니다)
4번째 줄: 4번째 줄:


{{소스헤더|parent.sh}}
{{소스헤더|parent.sh}}
<source lang='bash'>
<syntaxhighlight lang='bash'>
#!/bin/bash
#!/bin/bash
set -ax
set -ax
source child1.sh
syntaxhighlight child1.sh
./child2.sh
./child2.sh
</source>
</syntaxhighlight>
{{소스헤더|child1.sh}}
{{소스헤더|child1.sh}}
<source lang='bash'>
<syntaxhighlight lang='bash'>
#!/bin/bash
#!/bin/bash
foo=hello
foo=hello
bar=world
bar=world
echo -- child1 end...
echo -- child1 end...
</source>
</syntaxhighlight>
{{소스헤더|child2.sh}}
{{소스헤더|child2.sh}}
<source lang='bash'>
<syntaxhighlight lang='bash'>
#!/bin/bash
#!/bin/bash
echo -- child2 start...
echo -- child2 start...
echo foo=[$foo]
echo foo=[$foo]
echo bar=[$bar]
echo bar=[$bar]
</source>
</syntaxhighlight>
{{소스헤더|실행결과}}
{{소스헤더|실행결과}}
<source lang='console'>
<syntaxhighlight lang='console'>
$ ./parent.sh  
$ ./parent.sh  
+ source child1.sh
+ syntaxhighlight child1.sh
++ foo=hello
++ foo=hello
++ bar=world
++ bar=world
36번째 줄: 36번째 줄:
foo=[hello]
foo=[hello]
bar=[world]
bar=[world]
</source>
</syntaxhighlight>


==같이 보기==
==같이 보기==
42번째 줄: 42번째 줄:
* [[리눅스 set -a]]
* [[리눅스 set -a]]
* [[리눅스 set -x]]
* [[리눅스 set -x]]
* [[리눅스 source]]
* [[리눅스 syntaxhighlight]]


[[분류: Bash]]
[[분류: 리눅스 set]]

2020년 11월 2일 (월) 02:40 기준 최신판

1 개요[ | ]

리눅스 set -ax
parent.sh
#!/bin/bash
set -ax
syntaxhighlight 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 
+ syntaxhighlight child1.sh
++ foo=hello
++ bar=world
++ echo child1 end...
child1 end...
+ ./child2.sh
-- child2 start...
foo=[hello]
bar=[world]

2 같이 보기[ | ]

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