Skip to content

Instantly share code, notes, and snippets.

View AlbertRockG's full-sized avatar
🎯
Focusing

Albert Rock A. Gangbadja AlbertRockG

🎯
Focusing
View GitHub Profile
@AlbertRockG
AlbertRockG / bash_strict_mode.md
Created January 23, 2023 08:02 — forked from vncsna/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation

set -e, -u, -o, -x pipefail

The set lines

  • These lines deliberately cause your script to fail. Wait, what? Believe me, this is a good thing.
  • With these settings, certain common errors will cause the script to immediately fail, explicitly and loudly. Otherwise, you can get hidden bugs that are discovered only when they blow up in production.
  • set -euxo pipefail is short for:
set -e
set -u

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r