-
-
Save nenadg/6e8d4a90ef882dafab797eef189b88b9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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