Tagged articles
trap
11 articles · Page 1 of 1
This guide explains why background loops in Bash scripts can linger after the script ends, how they become orphaned under init/systemd, and provides robust techniques—including trap, kill, pkill, and signal 0—to ensure all child processes are terminated when the script exits.
Process Managementbashkill
0 likes · 11 min read

This article explains why background loops in Bash scripts can survive script termination, demonstrates the problem with concrete examples, and provides robust solutions using trap, killall/pkill, and kill 0 to ensure all child processes exit together.
Scriptbashprocess
0 likes · 12 min read

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.
ScriptSignalsbash
0 likes · 11 min read

This article explains why background loops in Bash scripts survive script termination, shows how they become orphaned under init/systemd, and provides robust techniques—including kill, killall, pkill, and trap handlers—to ensure all child processes are terminated when the script exits.
bashscript self‑terminationtrap
0 likes · 12 min read

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.
ConditionalsLoopsbash
0 likes · 14 min read

This guide provides a comprehensive walkthrough of Bash scripting fundamentals, covering conditional statements, various loop constructs, signal handling with trap, and a collection of useful one‑line scripts and visual examples for everyday tasks.
ConditionalsLoopsbash
0 likes · 14 min read

This article explains the types and default actions of Linux signals, distinguishes between standard and real‑time signals, and demonstrates how to use the kill and trap commands with practical shell script examples for signal handling.
LinuxSignalskill
0 likes · 7 min read

This article explains Linux signal concepts, the three ways a process can handle signals, provides a concise reference of common signals with their default actions, and demonstrates practical usage of the kill and trap commands through clear shell script examples.
Signalskillos
0 likes · 9 min read


ITPUBSep 13, 2018 · Fundamentals
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.
ShellCheckbashdebugging
0 likes · 10 min read

This guide walks you through Bash scripting fundamentals, covering conditional statements (if, case), four loop types (for, while, until, select), loop control commands (continue, break, shift), signal trapping with trap, plus practical examples and handy one‑liners for automation.
ConditionalsLoopsbash
0 likes · 12 min read


ITPUBAug 9, 2017 · Backend Development
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.
Best PracticesShellCheckVariable Expansion
0 likes · 10 min read
