Compare commits
2 commits
9f1862f150
...
bc4d76f633
Author | SHA1 | Date | |
---|---|---|---|
bc4d76f633 | |||
5d58c84be4 |
3 changed files with 23 additions and 1 deletions
2
Makefile
2
Makefile
|
@ -1,4 +1,4 @@
|
|||
CFLAGS := -Wall -Wextra
|
||||
CFLAGS := -Wall -Wextra -std=gnu23
|
||||
|
||||
main: main.c
|
||||
gcc ${CFLAGS} -o $@ $^
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
= Cからシェルスクリプトを呼ぶテスト
|
||||
* 作業ディレクトリが変わらないので注意
|
||||
* 適切にオプションを設定しないとエラー検知できないので注意
|
||||
|
||||
== 使い方
|
||||
`make`
|
||||
|
||||
`./noset_nocd.patch` のパッチを当てると、ちゃんとしたスクリプトになってくれる。
|
||||
|
|
17
noset_nocd.patch
Normal file
17
noset_nocd.patch
Normal file
|
@ -0,0 +1,17 @@
|
|||
diff --git a/subdir/entry.sh b/subdir/entry.sh
|
||||
index 4e7b013..b070a09 100755
|
||||
--- a/subdir/entry.sh
|
||||
+++ b/subdir/entry.sh
|
||||
@@ -1,10 +1,10 @@
|
||||
#!/bin/env bash
|
||||
-set -euo pipefail
|
||||
+# set -euo pipefail
|
||||
echo "Hi, this is entry.sh"
|
||||
echo "pwd:"
|
||||
pwd
|
||||
echo "\${0}: ${0}"
|
||||
-cd "$(dirname "${0}")"
|
||||
+# cd "$(dirname "${0}")"
|
||||
./called.sh
|
||||
echo $?
|
||||
echo "returned"
|
Loading…
Reference in a new issue