Automatically create shortcuts to host and host group directories
[abe:zshrc.git] / zsh.d / 55-hash
1 # -*- sh -*-
2
3 if [[ -d /var/imap/a/abe ]]; then
4     hash -d imap=/var/imap/a/abe
5 fi
6
7 if [[ "$NISDOMAINNAME" = "phys.ethz.ch" ]]; then
8     hash -d local=/pub/debian-local
9     hash -d configs=/pub/debian-local/configs
10     hash -d byhost=/pub/debian-local/configs/byHost
11     hash -d bygroup=/pub/debian-local/configs/byGroup
12
13     # All our current and probably future distributions
14     for d in etch lenny squeeze wheezy jessie karmic lucid maverick natty oneiric precise quantal raring saucy trusty utopic; do
15         if [[ -d /pub/debian-local/configs/$d ]]; then
16             hash -d $d=/pub/debian-local/configs/$d
17         fi
18     done
19
20     # Create ~$HOST and ~$HOSTGROUP shortcuts
21     for h in /pub/debian-local/configs/byHost/*/ /pub/debian-local/configs/byGroup/*/; do
22         name=${h:t}
23         hash -d $name=$h
24     done
25 fi
26
27 if [[ -d /usr/share/doc/debian-policy ]]; then
28     hash -d policy=/usr/share/doc/debian-policy
29 fi
30
31 if [[ -d /usr/share/doc/developers-reference ]]; then
32     hash -d reference=/usr/share/doc/developers-reference
33 fi
34
35 # From corekeeper
36 if [[ -d /var/log/core ]]; then
37     hash -d core=/var/log/core
38 fi