مبتدئ
Bash
تعلم كتابة سكربتات Bash من المتغيرات إلى سكربتات جاهزة للإنتاج. الحلقات, المصفوفات, الاعتراضات, set -euo pipefail, ومشروع تطبيقي لتهيئة خادم.
12 دروس5.7h تطبيقي11 لغات
ابدأ التعلّم مجاناًBash دورة12 درسًا، بالترتيب
- 120 دقيقة
ما هو Bash
Shell vs terminalBash vs sh vs zshInteractive shell vs scriptWhere Bash fits in DevOps - 225 دقيقة
سطر Shebang وأول سكريبت لك
Shebang#!/usr/bin/env bashChmod +x./script.sh vs bash script.shExit codes - 325 دقيقة
المتغيرات وعلامات الاقتباس
Variable assignmentDouble quotes vs single quotes${var} bracesCommand substitution $(...) - 430 دقيقة
الشروط والاختبارات
If statement[[ ]] testsString testsFile tests -f -d -e&& and ||Case statement - 525 دقيقة
الحلقات
For loopWhile loopUntil loopFor f in *.txt globbingC-style for loopBreak and continue - 625 دقيقة
الدوال
Function definitionPositional args $1 $@ $#Return for exit codesEcho for outputLocal variables - 725 دقيقة
المصفوفات
Indexed arrays${arr[@]}${#arr[@]} lengthAssociative arrays declare -AIterating arrays - 825 دقيقة
توسيع النصوص والعمليات الحسابية
${var#prefix}${var%suffix}${var//old/new}$(( arith ))Printf formatting - 925 دقيقة
إعادة توجيه المدخلات والمخرجات والأنابيب
>>><2>2>&1&>+3 - 1030 دقيقة
معالجة الأخطاء والاعتراضات
Set -eSet -uSet -o pipefailTrap on EXITTrap on ERRCleanup functions - 1125 دقيقة
تصحيح الأخطاء وأفضل الممارسات
Bash -xSet -xShellcheckSafe quotingNever parse ls[[ vs [+1 - 1260 دقيقة
مشروع التخرج: سكربت تهيئة الخادم
Idempotent provisioningInstalling packagesCreating usersSSH key setupSystemd timersLogging+2
تعلّم Bash بلغتك
كل درس واختبار ورد من المدرس يظهر بلغتك. المدرس الذكي يرد بنفس اللغة التي تكتب بها.
