Skip to main content
3 of 3
added 39 characters in body

ignore whitespace at the beginning of a search pattern

This sed expression works, but is there a better way to represent the white space in both the search pattern and replace string?

BRANCHTAG=7.17.9-main-5ee3e99d5ff002862d93728d821461033de1186d
PRIOR_VERSION=7.17.4
clear; sed "s/^    newTag: ${PRIOR_VERSION}.*$/    newTag: ${BRANCHTAG}/" kustomization.yaml

I cannot just search on newTag as that would replace all newTag strings in the file