Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
cmd () {
CMD="$1"
DOCKER_CMD="docker run --rm --volumes-from ${CONT_NAME} ubuntu:14.04 bash -c \"sub1\""
eval `echo $DOCKER_CMD | sed "s/sub1/${CMD}/"`
}
cmd "ls -l"
# läuft!
cmd () {
CMD="$1"
docker run --rm --volumes-from ${CONT_NAME} ubuntu:14.04 bash -c \"${CMD}\"
}
cmd "ls -l"
# läuft nicht:
# -l": -c: line 0: unexpected EOF while looking for matching `"'
# -l": -c: line 1: syntax error: unexpected end of file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment