grep -rl "#bash" ~/writing ~/notes
#bash
1 post and 2 notes tagged bash.
20261 post
- 7 min
Write boring shell scripts
A few conventions that make small Bash automation safer to rerun, easier to debug, and less surprising six months later.
Notes
- TIL
Stop grep matching itself without grep -v grep
ps aux | grep nginx always lists the grep nginx process too, which is why | grep -v grep is so common. Wrap one character of the pattern in brackets instead:…
- TIL
Print a value in reusable shell quoting
Bash 4.4 added the @Q parameter transformation, which quotes a value so it can be pasted back into a shell unchanged: Handy in logs: echo "running:…