Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
shell:if-for-while-function-variable [2026/01/19 15:23] – [While] tmadeshell:if-for-while-function-variable [2026/10/19 16:38] (current) – [Function] tmade
Line 424: Line 424:
 </code> </code>
  
 +Check, when a folder will be created:
  
 +<code>
 +#!/bin/bash
 +
 +# Path to folder
 +FOLDER="/path/to/folder"
 +
 +echo "Wait until: $FOLDER"
 +
 +# ! -d prüft, ob das Verzeichnis NOCH NICHT existiert
 +while [ ! -d "$FOLDER" ]; do
 +    sleep 1 # waiting....
 +done
 +
 +echo "Folder $FOLDER found! Loop terminated."
 +</code>
 ==== Function ==== ==== Function ====
  
Line 449: Line 465:
 fi fi
 </code> </code>
 +
 +<code>
 +#!/bin/bash
 +
 +function test {
 +echo $1
 +echo $2
 +}
 +
 +test first second
 +</code>
 +
 +Output:
 +  first
 +  second
 +
 +
 +
  
 Example: Example:
shell/if-for-while-function-variable.1768832636.txt.gz · Last modified: by tmade
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 4.0 International
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki