From: Eric Lovejoy
Subject: Bash Feature Proposal
Date: Mon, 9 Feb 2026 10:29:53 -0500
>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.
I think the idea of setting up a separate website (*) for this is good.
Putting a pointer to it here and possibly other such sites (such as
the help-bash list) seems reasonable.
(*) As you have already done.
>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?
>Potential downside:
>naming directories "-7" or any negative number might cause an issue in
>directory traversal.
Worse, I think, is the fact that "-" is pretty much already taken for
introducing options for commands - and note that cd already has a few
options defined.
FWIW, I've implemented this a few times over the years, in various
shells, as a command called "up". So, instead of your "cd -2", you
would just do "up 2". It would be simple to implement this as a bash
shell function. I generally avoid "overloading" already existing
commands.
Note also, in response to your general question about the ethos of
suggesting things like this: The general feeling in these lists is
that the following pecking order should be observed:
1) If you can do it purely in script code, best.
if not, then
2) If you can do it as an extension library, OK.
if not, then
3) Last resort, do it in the core (i.e., in the main code)
This seems to be the general feeling in both of the scripting
languages (bash and GAWK) that I closely follow.
#1 is best, primarily because anyone can do it. You don't need to
write C code or mess around with compilers.
=================================================================================
Please do not send me replies to my posts on the list.
I always read the replies via the web archive, so CC'ing to me is unnecessary.
When responding to my posts, please try to refrain from giving bureaucratic
answers.
If you have nothing useful to say, then just click Next and go on.