We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1f04771 commit 3e8ed0bCopy full SHA for 3e8ed0b
1 file changed
test/quoted_arguments.sh
@@ -0,0 +1,36 @@
1
+#!/bin/sh
2
+
3
+TRY_TOP="${TRY_TOP:-$(git rev-parse --show-toplevel --show-superproject-working-tree 2>/dev/null || echo "${0%/*}")}"
4
+TRY="$TRY_TOP/try"
5
6
+cleanup() {
7
+ cd /
8
9
+ if [ -d "$try_workspace" ]
10
+ then
11
+ rm -rf "$try_workspace" >/dev/null 2>&1
12
+ fi
13
14
+ if [ -f "$expected" ]
15
16
+ rm "$expected"
17
18
+}
19
20
+trap 'cleanup' EXIT
21
22
+try_workspace="$(mktemp -d)"
23
+cd "$try_workspace" || exit 9
24
25
+expected="$(mktemp)"
26
+cat >"$expected" <<'EOF'
27
+hello world
28
+it's ok
29
+EOF
30
31
+arg1="hello world"
32
+arg2="it's ok"
33
34
+"$TRY" printf '%s\n' "$arg1" "$arg2" >out.txt || exit 1
35
36
+diff -q "$expected" out.txt
0 commit comments