Skip to content

Instantly share code, notes, and snippets.

@frode-carlsen
Created January 20, 2020 09:59
Show Gist options
  • Save frode-carlsen/2cb93b1034efbdac7dbf35b7bc252530 to your computer and use it in GitHub Desktop.
Save frode-carlsen/2cb93b1034efbdac7dbf35b7bc252530 to your computer and use it in GitHub Desktop.
Sed replace list of key values from file into another
sed -r "$(sed -e 's|\([^=]*\)=\(.*\)|''s\|\1\|\2\|g;''|g; ' input-patterns.txt | grep -v -E '(^$)|#' | tr '\n' ' ')" <input-file.yaml >new-file.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment