Comment

Comment by throwaway_au_1

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 syntactically 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
    )

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton