<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Bash on FISI Lernzettel</title><link>https://hugo.globuklumbo.de/tags/bash/</link><description>Recent content in Bash on FISI Lernzettel</description><generator>Hugo</generator><language>de</language><atom:link href="https://hugo.globuklumbo.de/tags/bash/index.xml" rel="self" type="application/rss+xml"/><item><title>Shell-Scripting Grundlagen (Bash)</title><link>https://hugo.globuklumbo.de/07_softwareentwicklung/shell-scripting/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://hugo.globuklumbo.de/07_softwareentwicklung/shell-scripting/</guid><description>&lt;h1 id="shell-scripting-grundlagen-bash"&gt;Shell-Scripting Grundlagen (Bash)&lt;a class="anchor" href="#shell-scripting-grundlagen-bash"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;Ein &lt;strong&gt;Shell-Skript&lt;/strong&gt; ist eine Textdatei mit einer Abfolge von Befehlen, die von einer Shell (unter Linux/Unix meist &lt;strong&gt;Bash&lt;/strong&gt;, Bourne Again Shell) nacheinander ausgeführt wird. Statt wiederkehrende Administrationsaufgaben — Backups, Aufräumarbeiten, Prüfungen des Systemzustands — jedes Mal manuell einzutippen, werden sie in einem Skript automatisiert und reproduzierbar gemacht.&lt;/p&gt;
&lt;h2 id="grundlegende-bash-konzepte"&gt;Grundlegende Bash-Konzepte&lt;a class="anchor" href="#grundlegende-bash-konzepte"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;h3 id="shebang"&gt;Shebang&lt;a class="anchor" href="#shebang"&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Jedes Bash-Skript beginnt mit der &lt;strong&gt;Shebang-Zeile&lt;/strong&gt;, die dem System mitteilt, welcher Interpreter es ausführen soll:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#cdd6f4;background-color:#1e1e2e;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#6c7086;font-style:italic"&gt;#!/bin/bash&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="variablen"&gt;Variablen&lt;a class="anchor" href="#variablen"&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Variablen werden ohne Typangabe zugewiesen (kein Leerzeichen um das &lt;code&gt;=&lt;/code&gt;) und mit &lt;code&gt;$&lt;/code&gt; ausgelesen:&lt;/p&gt;</description></item></channel></rss>