Anfänger
Bash
Lernen Sie Bash-Scripting von Variablen bis hin zu robusten, produktionsreifen Skripten. Schleifen, Arrays, Traps, set -euo pipefail und ein Server-Bootstrap-Abschlussprojekt.
12 Lektionen5.7h praktisch11 Sprachen
Kostenlos lernenBash Kurs12 Lektionen, der Reihe nach
- 120 Min.
Was ist Bash
Shell vs terminalBash vs sh vs zshInteractive shell vs scriptWhere Bash fits in DevOps - 225 Min.
Shebang und dein erstes Skript
Shebang#!/usr/bin/env bashChmod +x./script.sh vs bash script.shExit codes - 325 Min.
Variablen und Anführungszeichen
Variable assignmentDouble quotes vs single quotes${var} bracesCommand substitution $(...) - 430 Min.
Bedingungen und Tests
If statement[[ ]] testsString testsFile tests -f -d -e&& and ||Case statement - 525 Min.
Schleifen
For loopWhile loopUntil loopFor f in *.txt globbingC-style for loopBreak and continue - 625 Min.
Funktionen
Function definitionPositional args $1 $@ $#Return for exit codesEcho for outputLocal variables - 725 Min.
Arrays
Indexed arrays${arr[@]}${#arr[@]} lengthAssociative arrays declare -AIterating arrays - 825 Min.
String- und arithmetische Expansion
${var#prefix}${var%suffix}${var//old/new}$(( arith ))Printf formatting - 925 Min.
E/A-Umleitung und Pipes
>>><2>2>&1&>+3 - 1030 Min.
Fehlerbehandlung und Traps
Set -eSet -uSet -o pipefailTrap on EXITTrap on ERRCleanup functions - 1125 Min.
Debugging und Best Practices
Bash -xSet -xShellcheckSafe quotingNever parse ls[[ vs [+1 - 1260 Min.
Abschlussprojekt: Server-Bootstrap-Skript
Idempotent provisioningInstalling packagesCreating usersSSH key setupSystemd timersLogging+2
Lerne Bash in deiner Sprache
Jede Lektion, jedes Quiz und jede Tutor-Antwort erscheint in deiner Sprache. Der KI-Tutor antwortet in der Sprache, in der du fragst.
