X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=etc%2Fzsh%2Fzshrc;h=9c6fd94d044fbae654ebcea73d3125de7a996ada;hb=515cabf5944aa1d1b31e71393d0cf38adc97782d;hp=c1b4955b6b0083f5c20c47754acfbf40ec9d1d06;hpb=35c81f6a5a7cc4b5b77a5a1d263dffee72332a91;p=grml-etc-core.git diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index c1b4955..9c6fd94 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -3573,6 +3573,20 @@ purge() { fi } +#f5# show labels and uuids of disk devices +if is439 && [[ -d /dev/disk/by-id/ ]]; then + lsdisk() { + emulate -L zsh + setopt extendedglob + local -a -U disks + disks=( /dev/disk/by-id/*(@:A) ) + for dev in "$disks[@]"; do + print ${fg_bold[red]}${dev}${reset_color} /dev/disk/by-label/*(@e/'[[ ${REPLY:A} == $dev ]] && REPLY=${fg[blue]}LABEL=${REPLY:t}${reset_color}'/N) /dev/disk/by-uuid/*(@e/'[[ ${REPLY:A} == $dev ]] && REPLY=${fg[green]}UUID=${REPLY:t}${reset_color}'/N) + print -f " %s\n" /dev/disk/by-id/*(@e/'[[ ${REPLY:A} == $dev ]]'/N:t) + done + } +fi + # Translate DE<=>EN # 'translate' looks up fot a word in a file with language-to-language # translations (field separator should be " : "). A typical wordlist looks