mkdir doesn't handle mkdir -7, and cd -7 already breaks existing cd
functionality.
my method turns the bug into a feature.

On Thu, Feb 26, 2026 at 4:01 AM Petr Derian <[email protected]> wrote:

> Hello,
>
> The lines outlined below were written in response to Eric Lovejoy's
> question and are placed in the ~/.bash_aliases file.
>
> po 9. 2. 2026 v 17:27 odesílatel Eric Lovejoy via Bug reports for the
> GNU Bourne Again SHell <[email protected]> napsal:
> >
> > Hi All,
> > Not really sure who to write to for feature requests / submissions.
> > I can write the features, it's who or where to submit them which has
> > baffled me.
> >
> > One Feature I would like to propose is an addition to the Bash shell
> > builtin cd,
> >
> > cd -N :: change dir by N directories.
> >       $cd -3  # go up 3 directories.
> >       $cd -0  # no operation
> >       $cd -2  # go up 2 directories
> >   Goal save some key strokes? avoid this: cd ../../../../ type of thing.
> >        scripting possibilities?
> >
>
> # ~/.bash_aliases
>
> # go up in the tree structure
> alias cd...........="cd11"
> alias cd..........="cd10"
> alias cd.........="cd9"
> alias cd........="cd8"
> alias cd.......="cd7"
> alias cd......="cd6"
> alias cd.....="cd5"
> alias cd....="cd4"
> alias cd...="cd3"
> alias cd..="cd2"
> alias cd.="cd1"
> alias # bash-bug
> alias cd0="echo Try: cd5  or  cd.....  or  cd { ../../../../..; pwd; }"
> alias cd1="{ cd ..; pwd; }"
> alias cd2="{ cd ../..; pwd; }"
> alias cd3="{ cd ../../..; pwd; }"
> alias cd4="{ cd ../../../..; pwd; }"
> alias cd5="{ cd ../../../../..; pwd; }"
> alias cd6="{ cd ../../../../../..; pwd; }"
> alias cd7="{ cd ../../../../../../..; pwd; }"
> alias cd8="{ cd ../../../../../../../..; pwd; }"
> alias cd9="{ cd ../../../../../../../../..; pwd; }"
> alias cd10="{ cd ../../../../../../../../../..; pwd; }"
> alias cd11="{ cd ../../../../../../../../../../..; pwd; }"
>
>
> >
> > Potential downside:
> > naming directories "-7" or any negative number might cause an issue in
> > directory traversal.
> >
> >
> > https://github.com/FOSSBOSS/bashMods
> >
> > love it or hate it, I have other ideas, and contributions I would like to
> > make to gnu software.
> > I still want to know how to propose new features.
>
> Polite regards.
>
> Petr Derian
>

Reply via email to