diff options
Diffstat (limited to 'bash/bashrc')
-rw-r--r-- | bash/bashrc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/bash/bashrc b/bash/bashrc index 2e48a70..4cf0273 100644 --- a/bash/bashrc +++ b/bash/bashrc @@ -27,6 +27,22 @@ fi # XXX should this be here? stty -ixon +cu() +{ + local lvl=$1 + if ! [[ "${lvl}" =~ ^[0-9]+$ ]]; then + echo "Parameter must be a non-negative integer: ${lvl}" + return 1 + fi + + local dir="" + for i in $(seq "${lvl}"); do + dir=${dir}../ + done + + cd "${dir}" +} + # define the prompt . ~/.config/bash/prompt PS1=$(__prompt_func) |