zshrc.d/30-functions.zrc
changeset 6 7671e95ab8b0
parent 5 5dbc9ebf690c
child 37 9c238177f98a
equal deleted inserted replaced
5:5dbc9ebf690c 6:7671e95ab8b0
    37             cd $dir >&/dev/null
    37             cd $dir >&/dev/null
    38         fi
    38         fi
    39     done
    39     done
    40 }
    40 }
    41 
    41 
       
    42 # This function seen in Frank Terbeck config files is an improvement over
       
    43 # my previous mkcd alias...
       
    44 functions mkcd() {
       
    45     [[ -z $1 ]] && printf 'usage: mkcd NEW-DIRECTORY\n' && return 1
       
    46     [[ -d $1 ]] && printf 'mkcd: Directory %s already exists; cd-ing\n' $1
       
    47     command mkdir -p -- $1
       
    48     builtin cd -- $1
       
    49 }
    42 
    50 
    43 # genpass()
    51 # genpass()
    44 # Generates a tough password of a given length
    52 # Generates a tough password of a given length
    45 # Borrowed (and slightly modifed) from Seth House github repository.
    53 # Borrowed (and slightly modifed) from Seth House github repository.
    46 
    54