Przejdź do treści

⚠️ 60-anti-patterns Index

🚫 Anti-Patterns Section

Common mistakes and pitfalls to avoid in shell scripting.

📖 Contents

🎯 Learning Objectives

✅ Recognize and avoid common shell scripting pitfalls ✅ Understand why certain approaches lead to problems ✅ Develop defensive programming habits ✅ Learn from others' mistakes to write better code

🔍 Quick Reference

Anti-Pattern Problems Caused Better Alternative
Pipeline Abuse Unreadable, fragile code Modular functions
Echo Data Security risks, parsing issues Proper serializers
Implicit Dependencies Portability issues Explicit validation
Interactive Automation Non-repeatable processes Configuration-driven
Bashisms Platform lock-in POSIX compliance
Shell Supervision Poor process management Dedicated supervisors
Silent Failures Hidden problems Explicit error handling

🚀 Learning Approach

  1. Study Each Anti-Pattern - Understand the problem
  2. Recognize in Code - Spot these patterns in existing scripts
  3. Refactor Away - Apply better alternatives
  4. Prevent Recurrence - Build habits to avoid these mistakes