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