質問編集履歴
3
コメントの修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -27,8 +27,8 @@
|
|
27
27
|
|
28
28
|
```sh
|
29
29
|
# /tmp/children/01-child.sh
|
30
|
+
pwd
|
30
|
-
|
31
|
+
echo $0 # 01-child.sh が出力されることを期待する
|
31
|
-
echo $0
|
32
32
|
```
|
33
33
|
|
34
34
|
### 実行結果
|
2
/tmp/parent.shの修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -22,12 +22,13 @@
|
|
22
22
|
|
23
23
|
```sh
|
24
24
|
# /tmp/parent.sh
|
25
|
-
./children/01-child.sh
|
25
|
+
. ./children/01-child.sh
|
26
26
|
```
|
27
27
|
|
28
28
|
```sh
|
29
29
|
# /tmp/children/01-child.sh
|
30
|
-
pwd #
|
30
|
+
pwd # ~~~~children/ が出力されることを期待する
|
31
|
+
echo $0
|
31
32
|
```
|
32
33
|
|
33
34
|
### 実行結果
|
@@ -38,8 +39,10 @@
|
|
38
39
|
|
39
40
|
❯ ./parent.sh
|
40
41
|
/tmp
|
42
|
+
./parent.sh
|
41
43
|
|
42
44
|
❯ cd children
|
43
45
|
❯ ./01-child.sh
|
44
46
|
/tmp/children
|
47
|
+
./01-child.sh
|
45
48
|
```
|
1
子シェルスクリプトのソースコードのコメント修正
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
cdを使わずに呼び出された子シェル自身のパスを取得する方法を知りたい
|
1
|
+
cdを使わずに呼び出された子シェルスクリプト自身のパスを取得する方法を知りたい
|
body
CHANGED
@@ -26,7 +26,7 @@
|
|
26
26
|
```
|
27
27
|
|
28
28
|
```sh
|
29
|
-
# /tmp/
|
29
|
+
# /tmp/children/01-child.sh
|
30
30
|
pwd # /tmp/children が出力されることを期待する
|
31
31
|
```
|
32
32
|
|