-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix argument passing to scripts being interpreted with '#!' shebang l…
…ines (#167) * Split the ELF binary format handling from the script binary format. This makes it more clear what code is doing what, and highlights that scripts aren't getting passed their arguments. * Don't forget to push the arguments to scripts being interpreted. Includes an integration test that passes on Linux as well.
- Loading branch information
Showing
3 changed files
with
93 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
|
||
for arg in "$@"; do | ||
echo $arg | ||
done | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/sh | ||
|
||
if [ -z "$TESTS_DIR" ]; then | ||
TESTS_DIR="." | ||
fi | ||
|
||
result=`${TESTS_DIR}/echo_args.sh 1 2 "3 4"` | ||
|
||
expected=$(cat <<EOF | ||
1 | ||
2 | ||
3 4 | ||
EOF | ||
) | ||
|
||
if [ "$result" != "$expected" ]; then | ||
echo "Failure:" | ||
echo $result | ||
exit 1 | ||
fi | ||
|
||
echo Pass |