Created
December 28, 2021 12:10
-
-
Save kvaps/7ab0e6b6eb82af1c07b9f63e251233a8 to your computer and use it in GitHub Desktop.
Oneliner to replace indents with nindents in Helm chart
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
grep -rnoP '(?<= indent )[0-9]+' > /tmp/11 | |
cat /tmp/11 | awk -F: '{print $1 " " $2 " " $3}' | while read file line indent; do echo "file=$file line=$line indent=$indent"; sed -i -e "$line s/^ *{{-\?/$(printf '%0.s ' $(seq 1 $indent)){{-/" -e "$line s/ indent \([0-9]\+\)/ nindent \1/g " $file; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment