Benutzer-Werkzeuge

Webseiten-Werkzeuge


coding:bash

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
coding:bash [2024/08/31 11:53]
jango
coding:bash [2025/06/16 05:06] (aktuell)
admin
Zeile 1: Zeile 1:
 [[:linux|Linux]] console is programmed using bash. Siehe auch [[coding:batch|batch]] for [[:windows|windows]]. [[:linux|Linux]] console is programmed using bash. Siehe auch [[coding:batch|batch]] for [[:windows|windows]].
 +
  
 <code bash> <code bash>
Zeile 32: Zeile 33:
     echo "Zeile: $line"     echo "Zeile: $line"
 done done
 +</code>
 +
 +Arrays
 +
 +<code bash>
 +#!/bin/bash
 +
 +# Declare an associative array called fruits
 +declare -A fruits
 +
 +# Assign key-value pairs to the array
 +fruits[apple]="red"
 +fruits[banana]="yellow"
 +fruits[grape]="purple"
 +
 +# Print specific element
 +echo "The color of an apple is ${fruits[apple]}."
 +
 +# Iterate through the array
 +for key in "${!fruits[@]}"; do
 +  echo "$key: ${fruits[$key]}"
 +done
 +</code>
 +
 +=====EOF=====
 +
 +<code bash>
 +cat <<'EOF'
 +Das ist ein Test
 +
 +Mehr Zeilen
 +EOF
 +</code>
 +
 +<code bash>
 +test=$(cat <<'EOF' 
 +Das ist ein Test
 +
 +Mehr Zeilen
 +EOF
 +)
 +</code>
 +
 +<code bash>
 +cat <<'EOF' > /test.txt
 +Das ist ein Test
 +
 +Mehr Zeilen
 +EOF
 </code> </code>
  
coding/bash.1725098009.txt.gz · Zuletzt geändert: 2024/08/31 11:53 von jango