Issue #58: Fix the command execution under CLI

This commit is contained in:
Filippo Squillace 2015-04-04 16:29:55 +02:00
parent 166a629086
commit 8d9dda2453
2 changed files with 12 additions and 1 deletions

View file

@ -190,7 +190,7 @@ function _run_juju_with_proot(){
if [ "$1" != "" ]
then
_run_proot "${proot_args}" "${@}"
insert_quotes "${@}" | _run_proot "${proot_args}" "${SH[@]}"
else
_run_proot "${proot_args}" "${SH[@]}"
fi

View file

@ -67,3 +67,14 @@ function ask(){
fi
}
function insert_quotes(){
# It inserts quotes between arguments.
# Useful to preserve quotes on command
# to be used inside sh -c/bash -c
C=''
for i in "$@"; do
C="$C \"${i//\"/\\\"}\""
done
echo ${C}
}