BTS

Message5578

Author Xk2c
Recipients Xk2c
Date 2015-10-10.10:59:01
Content
Hello Frank,
Hello Mika,

grmls zshrc contain this lines:
---<---<---<---<---<---<---<---<---<---<---<---<---<---<---<
    # Enabling NULL_GLOB via (N) weeds out any non-existing
    # directories from the saved dir-stack file.
    dirstack=( ${(f)"$(< $DIRSTACKFILE)"}(N) )
---<---<---<---<---<---<---<---<---<---<---<---<---<---<---<

I testet in a clean environment with only grml zshrc and actually
this does not work for me. If $DIRSTACKFILE contain lines with
non-existing dirs these are not weed out but are happily applied
to dirstack=().

This snippet does what i expect:
---<---<---<---<---<---<---<---<---<---<---<---<---<---<---<
    # DOES not work :/
    # # Enabling NULL_GLOB via (N) weeds out any non-existing
    # # directories from the saved dir-stack file.
    # dirstack=( ${(f)"$(< ${DIRSTACKFILE})"}(N) )

    dirstack=()
    dirstacktmp=( ${(f)"$(< ${DIRSTACKFILE})"}(N) )
    for d in "${dirstacktmp[@]}"; do
        [[ -d ${d} ]] && dirstack+=( ${d} )
    done
    builtin typeset -U dirstack
    builtin unset dirstacktmp
---<---<---<---<---<---<---<---<---<---<---<---<---<---<---<


Additionally:
I have created a little function _dirstack_helper() attached
and a "gui" for it xs(), which is the left hand of cd.

But since i am not sure whether those two are wanted in grml i
attached them as is, prior to spending time on hammering them
into a patch.
If you say you would include them i would do that.
Files
File name Uploaded
0001-make-dirstack-work-as-advertised.patch Xk2c, 2015-10-10.10:59:01
History
Date User Action Args
2015-10-10 10:59:01Xk2csetrecipients: + Xk2c
2015-10-10 10:59:01Xk2csetmessageid: <1444474741.77.0.953159533894.issue1934@bts.grml.org>
2015-10-10 10:59:01Xk2clinkissue1934 messages
2015-10-10 10:59:01Xk2ccreate