====== Zsh Workshop ====== von [[xro:xro|Bernhard]] === Geplante Themen des Workshops === * Einführung * zsh globbing * zsh substitution * zle tricks und keybindings * scripting compfort * Austausch von zsh Usern * Rant über Dinge die verbessert gehören, * .zshrc feature requests * writing zsh completions (wenn noch viel viel Zeit übrig sein sollte) ==== Sammlung an guten zsh Konfigurationen ==== * grml: ''apt-get install grml-etc-core'' * xro: ''wget [[https://www.tittelbach.at/zsh/.zshrc]] [[https://www.tittelbach.at/zsh/.zshrc.local]] [[https://www.tittelbach.at/zsh/.zshrc.pre]]'' \\ then execute zsh and optionally execute UpdateMyZshrc ==== Nützliche Doku Links ==== * Zsh - Die magische Shell (Sven Guckes, Julius Plenz) - ISBN 978-3-937514-59-8 * [[http://www.bash2zsh.com/zsh_refcard/refcard.pdf|ReferenceCard (pdf)]] * [[http://grml.org/zsh/grml-zsh-refcard.pdf|Grml Zsh ReferenceCard (pdf)]] * http://grml.org/zsh/ * http://grml.org/zsh-pony/ * http://zshwiki.org/home/ * http://www.bash2zsh.com/ * http://www.guckes.net/zsh/ ==== Hilfesystem Keyboard Shortcuts ==== * ''TAB'' - die Tab-completion, der beste Freund des Users * ''Ctrl-Xz'' - Liste der wichtigsten ZSH/Grml/Xro Keybindings (Shortcut mehrmals verwenden um durch alle Seiten zu blättern) * ''Ctrl-Xg'' - Liste und Beispiele für Globbing (Shortcut mehrmals verwenden um durch alle Seiten zu blättern) * ''Ctrl-Xb'' - Liste der mit ,. zu expandierend zsh aBkürzungen im assoziativen Array $abk * ''Alt-h'' - Zeige man-page von Kommando unter dem Cursor ==== CL History Auszug des Workshop ==== echo "Welcome ;-)" bindkey setopt setopt noautoremoveslash unsetopt noautoremoveslash compdef _gnu_generic inkscape cdt echo "IMPORTANT" > {a-z}.txt la qmv *.txt la imv *.txt echo "DELETEME" >| {00..20}.txt setopt noclobber echo abc > a.txt echo abc >| a.txt clear mkdir {a-z} lsnew which lsnew ls *(D.om[1,10]) ls *(D.Om[1,10]) ln -s abc def ln -s slsl slsl ln -s y.txt link.txt la la *(@) la *(-@) rm *(-@) chgrp nogroup e.txt rm *(g:nogroup:) la print *.txt(.:r) print ./*.txt(.:h) print ./*.txt(.:t) print ./*.txt(@:A) print *(@:A) print *(@) rm *(L-5) rm *(.e:'grep -q DELETE $REPLY':) alias contains print $functions[eg] for var in a b c d; do echo $var; done for var (a b c d) { echo $var; echo $var } inkscape --help compdef _gnu_generic inkscape print -a -C 2 ${(kv)abk} mkdir test cd test cd +1 mkdir altesdir mv *(.e%'nt a.txt'%) ./neuesdir/neuesubdir/ edfunc nt edfunc sameas mkdir -p dira/test dirb/test cd dirb/test cd dirb dira cat =(! f.txt exiftool -P -m -if 'not $gpslatitude' *.gpx(P:-geotag=:) -geosync=0:0:0 *.(#l)jpg ---- {{tag>workshop}}