Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
a26ad224
Commit
a26ad224
authored
Sep 27, 2015
by
Juan Benet
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1757 from ipfs/shell-quote
ipfs-test-lib: add shellquote()
parents
08e06764
1bd18205
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
test/ipfs-test-lib.sh
test/ipfs-test-lib.sh
+12
-0
No files found.
test/ipfs-test-lib.sh
View file @
a26ad224
...
...
@@ -22,3 +22,15 @@ test_sort_cmp() {
sort
"
$2
"
>
"
$2_sorted
"
&&
test_cmp
"
$1_sorted
"
"
$2_sorted
"
}
# Quote arguments for sh eval
shellquote
()
{
_space
=
''
for
_arg
do
printf
'%s'
"
$_space
"
printf
'%s'
"
$_arg
"
|
sed
-e
"s/'/'
\\\\
''/g; s/^/'/; s/
\$
/'/;"
_space
=
' '
done
printf
'\n'
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment