News for hackers. Stuff that matters.
Re:Learn to Process Text in Linux Using Grep, Sed, and Awk by throwaway_au_1 on Friday January 06, 2023 @05:58PM (#34282585)
I also don't enjoy coming back to large sed expressions I wrote previously but I'm starting to write them in a way that makes that much easier. I'm on my phone so this will probably be wrong but hopefully the gist is evident. Basically, load the expression from a commented 'file':

    sed ./target --file=<(cat <<- 
    SED_EXPR | grep -v -E '^\s*#'
        # do a string replacement 
        s#target#replacement#g
        
        # then do something else
        ..
    SED_EXPR
    )

There are no comments on this comment yet.