Paolo Redaelli personal blog

Category: Documentations

In bash scripting, the replacement of string is important because it allows you to modify a variable and the text of a file. It also helps in file and text processing and to validate user input.

To replace a string in bash, check the following methods:

  1. Using Parameter expansion: ${String/pattern/replacement}
  2. Using the sed command: sed 's/pattern/replacement/' filename
  3. Using the awk command: "input_str" | awk 'pattern { action }'
  4. Using the perl command: perl [options] -e 'action' filename
  5. Using the tr command: tr 'old_chars' 'new_chars' < "input_file"

Dive into the article to learn these methods of how to replace a bash string in detail.

Source: How to Replace String in Bash? [5 Methods] – LinuxSimply

How To Deal With Technical Debt.

Technical debt can cause so much frustration and burnout to development teams. Software engineers can be aware of the side effects of… Source: How To Deal With Technical Debt. Technical debt can cause so much… | by Dr Milan Milanović | Dec, 2023 | Medium