Created
May 16, 2016 04:47
-
-
Save dmohs/b50ea4302b62ebfc4f308a20d3de4213 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
IFS=$'\n\t' | |
set -euox pipefail | |
CNAME="$1" | |
FILE_PATH="$2" | |
TMPFILE="$(mktemp)" | |
docker exec "$CNAME" cat "$FILE_PATH" > "$TMPFILE" | |
$EDITOR "$TMPFILE" | |
cat "$TMPFILE" | docker exec -i "$CNAME" sh -c 'cat > '"$FILE_PATH" | |
rm "$TMPFILE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment