Tagged articles
11 articles
Page 1 of 1
Open Source Linux
Open Source Linux
Jun 24, 2024 · Operations

Self‑Terminating Bash Scripts with trap, kill, and pkill

This article explains why background loops in Bash scripts can become orphaned under init/systemd, demonstrates how to reliably terminate such scripts by using trap handlers with kill, killall, pkill, and signal 0, and provides robust examples for various execution scenarios.

Bashprocess-managementscript
0 likes · 11 min read
Self‑Terminating Bash Scripts with trap, kill, and pkill
Liangxu Linux
Liangxu Linux
Jun 6, 2021 · Operations

Master Bash Conditionals, Loops, and Signal Traps with Real‑World Examples

This article provides a comprehensive guide to Bash scripting, covering if/elif/else conditionals, case statements, four types of loops (for, while, until, select), signal trapping with trap, useful one‑liners for randomness and colored output, and several fun scripts such as a multiplication table, colored triangle, and chessboard.

BashConditionalsLoops
0 likes · 14 min read
Master Bash Conditionals, Loops, and Signal Traps with Real‑World Examples
ITPUB
ITPUB
Sep 13, 2018 · Fundamentals

8 Essential Shell Script Best Practices Every Developer Should Follow

This guide presents eight practical recommendations for writing robust Bash scripts, covering shebang selection, debugging flags, static analysis with ShellCheck, variable expansion, proper use of local, signal trapping, thoughtful coding habits, and choosing the right tool for the job.

BashShell scriptingShellCheck
0 likes · 10 min read
8 Essential Shell Script Best Practices Every Developer Should Follow
ITPUB
ITPUB
Aug 9, 2017 · Backend Development

8 Essential Shell Scripting Practices Every Developer Should Follow

This article shares eight hard‑earned recommendations for writing robust Bash scripts, covering shebang selection, debugging flags, static analysis, variable expansion, proper scoping, signal trapping, defensive coding, and knowing when to switch to a more suitable language.

BashError HandlingShell scripting
0 likes · 10 min read
8 Essential Shell Scripting Practices Every Developer Should Follow