User Tools

Site Tools


misc:code_snippets:shell

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
misc:code_snippets:shell [2017/08/25 20:13] – check_modules.sh hinzugefügt saschamisc:code_snippets:shell [2025/11/22 09:10] (current) – Einzeiler für Basispfad des ausgeführten Skripts sascha
Line 36: Line 36:
  
   cd -   cd -
 +
 +==== Basispfad des ausgeführten Skripts ermitteln ====
 +
 +  DIR=$( cd -- "$( dirname -- "$(readlink -f "${BASH_SOURCE[0]}" || ${BASH_SOURCE[0]})" )" &> /dev/null && pwd )
 +
 +Folgt auch Symlinks und funktioniert, wenn es mit ''source'' ausgeführt wird, ''#!/bin/sh'' hat bei mir ebenfalls geklappt.
  
 ==== Formatierung ''date'' ==== ==== Formatierung ''date'' ====
misc/code_snippets/shell.txt · Last modified: by sascha