top | item 34282585

(no title)

throwaway_au_1 | 3 years ago

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
    )

discuss

order

No comments yet.