news.volyx.in

Useful sed scripts and patterns (github.com)

528 points by adrianscheff · 1774 days ago · 121 comments on HN

Article summary

The article provides a collection of useful sed scripts and patterns for daily usage, covering various topics such as one-liners, substitutions, and file manipulation. It also includes a short tutorial on sed and lists some recommended books for further learning. The article aims to help users improve their sed skills and provide a reference for common sed use cases. The author has spent several hours recapping and improving the content, which has received positive feedback and contributions from the community.

Main themes

  • sed scripts and patterns
  • text processing
  • shell scripting
  • snippet management
  • learning resources
  • best practices

What commenters say

  • Some commenters pointed out errors and inconsistencies in the article, such as incorrect syntax and missing delimiters, which were later corrected by the author. The use of -E instead of -r is preferred for consistency across different sed implementations. A simple text file can be an effective way to manage and search a collection of snippets and scripts. Some users prefer to use their shell history file to store and search for relevant commands. The article has been helpful in introducing new sed patterns and techniques to some readers, despite some criticisms of its quality and accuracy. The hold space in sed can be confusing and is not thoroughly covered in the article, but it is considered an advanced topic. A sed script should ideally start with #!/usr/bin/sed -f instead of #!/bin/bash for better practice. Some users have developed their own tools and methods for managing snippets and scripts, such as using a personal wiki or a CLI snippet manager.
  • themes": ["sed scripts and patterns", "text processing", "shell scripting", "snippet management", "learning resources", "best practices"],