Shell Script

Aus MeinWiki
Wechseln zu: Navigation, Suche

Funktion

  • get script path
   # get script path
   GetScriptPath()
   {
       echo "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
   }
  • write logfile
   # write logfile
   # $1 Description
   # $2 Logfiledestination
   WriteLog ()
   {
       echo $(date "+%y%m%d-%H%M%S")' '$1 >> $2
   }