Useful sed scripts and patterns
github.com
Useful sed scripts and patterns
1–10 of 124 posts
Re: Useful sed scripts and patterns
#2Re: Useful sed scripts and patterns
#3Re: Useful sed scripts and patterns
#4“s '1,$ s/foo/bar/' file.txt”. should be replacement from 1 to end, not 5 to end (#4 on your list)
Re: Useful sed scripts and patterns
#5Re: Useful sed scripts and patterns
#6 sed 1d
Select line 123 sed -n 123p
# or
sed -n 123{p;q}Re: Useful sed scripts and patterns
#7Re: Useful sed scripts and patterns
#8They don’t need to be ready to go, but ideally:
- natural language searchable
- add a small description
- CLI to search, examine, and copy
- not a plugin
- sync with a GitHub repo.
Re: Useful sed scripts and patterns
#9FWIW, I'd argue that the path to true sed mastery eventually goes through the hold space, which isn't mentioned here. For some real fun, and an exercise that might change how you mentally model what sed is capable of, check out SedSokoban.
Re: Useful sed scripts and patterns
#10Something I crave in the worst way is a sensible story for accumulating a “toolbox” of snippets and scripts and commands. They don’t need to be ready to go, but ideally: - natural language searchable - add a small description - CLI to search, examine, and copy - not a plugin - sync with a GitHub repo.
Use a flat text in the editor of your choice. Search as needed. Tags work because you can seach them. You delimit each section as a note. I do it like this
---
Next note
---
It seems limited and primative, you don't get any markup or fun stuff. But it's soooo good. There is nothing to break or update. Seach is the method I use most anyway in my other note taking apps.
And you wind up putting everything in there, including commands that you're staging to run. Those staged commands become snippets later.