Skip to content

Instantly share code, notes, and snippets.

@mkoskinen
Last active April 22, 2018 10:29
Show Gist options
  • Save mkoskinen/2f9b06a649113403ac27641bbadf417b to your computer and use it in GitHub Desktop.
Save mkoskinen/2f9b06a649113403ac27641bbadf417b to your computer and use it in GitHub Desktop.
#!/bin/bash
ENVIRON='-e P="foo bar" -e X="hum ho"'
ESC_ENVIRON='-e P='\"'foo bar'\"' -e X='\"'hum ho'\"''
CMD="docker run -it --rm $ENVIRON ubuntu"
ESC_CMD="docker run -it --rm $ESC_ENVIRON ubuntu"
echo orig : $CMD
echo escapeddihipsut: $ESC_CMD
#$CMD
@mkoskinen
Copy link
Author

mkoskinen commented May 18, 2016

[markus@amaterasu ~]$ bash jussi.bash
orig : docker run -it --rm -e P="foo bar" -e X="hum ho" ubuntu
escapeddihipsut: docker run -it --rm -e P="foo bar" -e X="hum ho" ubuntu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment