Skip to content

Tag: linux

All the articles with the tag "linux".

Here Documents vs Here Strings in Bash

Here Documents vs Here Strings in Bash

· Updated:

Bash heredocs and here strings explained: <<EOF for multiline input, <<-EOF for tab-indented blocks, <<<string for single lines, and when to use each.

trap in Bash: Clean Up When Your Script Dies

trap in Bash: Clean Up When Your Script Dies

· Updated:

Use trap EXIT to clean up temp files, INT/TERM for graceful shutdown, and ERR for errors. Stop your bash scripts from leaving messes when they die.

bash `set -e` Doesn't Work Like You Think

bash `set -e` Doesn't Work Like You Think

· Updated:

set -e looks bulletproof, but it slips right through pipes, command substitution, and conditionals. The bash gotchas that bite at 2 AM, and how to fix them.