VIP 👤
🏠 Trang chủ
Benchmark
📊 Tất cả benchmark 🦖 Khủng long v1 🦖 Khủng long v2 ✅ Ứng dụng To-Do List 🎨 Trang tự do sáng tạo 🎯 FSACB - Trình diễn cuối cùng 🌍 Benchmark dịch thuật
Mô hình
🏆 Top 10 mô hình 🆓 Mô hình miễn phí 📋 Tất cả mô hình ⚙️ Kilo Code
Tài nguyên
💬 Thư viện prompt 📖 Thuật ngữ AI 🔗 Liên kết hữu ích 🔌 API và bộ định tuyến AI
intermediate

Bash Variable Expansion Edge Cases

#bash #shell-scripting #linux #sysadmin

Explain nuances of unset versus empty string variables in Bash scripting.

Explain the behavioral difference in Bash between testing if a variable is unset versus testing if it is set to an empty string "". Provide a script snippet demonstrating the difference between using -z, -n, and ${var:-default} expansions when the variable holds the value "".