Bash cheatsheet

From Lolly's Wiki
Revision as of 07:43, 25 May 2012 by Lollypop (talk | contribs) (Die Seite wurde neu angelegt: „=Nützliche Variablenersetzungen= ==dirname== <pre> $ myself=/usr/bin/blafasel ; echo ${myself%/*} /usr/bin </pre> ==basename== <pre> $ myself=/usr/bin/blafasel …“)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Nützliche Variablenersetzungen

dirname

$ myself=/usr/bin/blafasel ; echo ${myself%/*} 
/usr/bin

basename

$ myself=/usr/bin/blafasel ; echo ${myself##*/} 
blafasel

Kategorie:KnowHow