In D53499#1221677, @bdrewery wrote:I'm only intending this to target $(alias) and $(alias --). I don't think it would be common but I've at least written some code that duplicates some aliases with different handling if they exist, and found $(alias) forking unexpectedly.
- Feed Queries
- All Stories
- Search
- Feed Search
- Transactions
- Transaction Logs
Feed Search
Tue, Dec 30
Tue, Dec 30
Sat, Dec 27
Sat, Dec 27
Dec 7 2025
Dec 7 2025
Nov 29 2025
Nov 29 2025
Nov 19 2025
Nov 19 2025
Nov 17 2025
Nov 17 2025
Nov 16 2025
Nov 16 2025
Nov 15 2025
Nov 15 2025
Nov 7 2025
Nov 7 2025
jilles committed rGf9e79facf874: sh: Implement simple parameter expansion in PS1 and PS2 (authored by Matthew Phillips <matthew@matthewphillips.info>).
Nov 2 2025
Nov 2 2025
Oct 31 2025
Oct 31 2025
This is correct, and useful if there is a practical use case that frequently does $(alias) (but not $(alias NAME); a little more code would be needed). Please check the use cases so we add the right amount of logic here.
Sep 23 2025
Sep 23 2025
Sep 21 2025
Sep 21 2025
Sep 20 2025
Sep 20 2025
Sep 16 2025
Sep 16 2025
Sep 15 2025
Sep 15 2025
In D52527#1199611, @kevans wrote:I did wonder for a second if the /rescue variants of shells do or should assume setugid behavior and avoid loading dotfiles in case something in the profile or other bits finds a way to make the shell unusable, but I didn't really convince myself.
Sep 14 2025
Sep 14 2025
Aug 28 2025
Aug 28 2025
It seems reasonable to me to use .profile and other files from root's home directory in single user mode as well. Having no .profile at all in single user mode would be bad. I don't think special logic in pkg for hard links is worth it for this particular special case.
Aug 12 2025
Aug 12 2025
jilles committed rG01bb889cc1b1: wordexp(3): Handle ECHILD from waitpid (authored by Kenny Levinsen <kl@kl.wtf>).
jilles committed rG5c37f7d22fa7: wordexp(3): Handle ECHILD from waitpid (authored by Kenny Levinsen <kl@kl.wtf>).
Jul 8 2025
Jul 8 2025
jilles committed rGda9e73e5d483: wordexp(3): Handle ECHILD from waitpid (authored by Kenny Levinsen <kl@kl.wtf>).
Mar 8 2025
Mar 8 2025
In D49201#1122836, @pstef wrote:In D49201#1122784, @jilles wrote:This adds a non-POSIX feature (although it is pretty common); is the goal to make sh a mostly feature-complete alternative to bash?
Mar 4 2025
Mar 4 2025
This adds a non-POSIX feature (although it is pretty common); is the goal to make sh a mostly feature-complete alternative to bash?
Feb 22 2025
Feb 22 2025
Jun 7 2024
Jun 7 2024
Given that set -e is a controversial issue (see the disagreement here and in the "Conclusions" section of https://mywiki.wooledge.org/BashFAQ/105 ), I don't think the man page should recommend anything about it, although it should mention some pitfalls in a neutral manner.
May 4 2024
May 4 2024
The immediately preceding sentence about shell functions is an example of unexpected behaviour of set -e. The part "all commands of the function are considered to be tested as well" may result in code unexpectedly executing in the function and the function returning a different return status.
Dec 1 2023
Dec 1 2023
Nov 20 2023
Nov 20 2023
Nov 17 2023
Nov 17 2023
Nov 14 2023
Nov 14 2023
This looks like a reasonable quick fix, but I think it's unfortunate the /root directory permissions are specified both in bsd.dirs.mk variables and in the BSD.root.dist mtree file. It looks like the bsd.dirs.mk variables are required because of pkgbase.
Jul 4 2023
Jul 4 2023
Jun 8 2023
Jun 8 2023
jilles committed rG2178e8c27aad: sh: make smark a static variable instead of a local in main() (authored by daniel_octaforge.org).
Jun 4 2023
Jun 4 2023
I agree with the analysis, but the variables should still be defined inside main (with static) so they cannot be used outside. Some of the other functions in this file have their own smark locals that should not be mixed up with main's.
Jun 3 2023
Jun 3 2023
To me, it looks like that situation can't actually happen. If there is an error or SIGINT during early initialization, state will still be 0 and the if (setjmp(main_handler.loc)) block will immediately call exitshell(exitstatus) without touching smark. If I'm wrong, please provide a reproduction scenario.
Apr 28 2023
Apr 28 2023
Apr 27 2023
Apr 27 2023
This doesn't follow the Don't Repeat Yourself principle, but currently I don't have a better idea how to express this code.
Jan 5 2023
Jan 5 2023
Jan 1 2023
Jan 1 2023
Code is OK like this.
Dec 22 2022
Dec 22 2022
Dec 18 2022
Dec 18 2022
Dec 14 2022
Dec 14 2022
Adding support for escape sequences might make it important to increase PROMPTLEN.
Dec 11 2022
Dec 11 2022
In D37620#855668, @corvink wrote:Thanks for the hint. kill %+ and jobs -p %+ are already working. So, no patch required. Might be a good idea to mention it in the man page.
Dec 7 2022
Dec 7 2022
How do other shells with a similar option handle this? For example, zsh has a TRAPS_ASYNC option, but does not document how to access the interrupted job in the trap action.
Oct 23 2022
Oct 23 2022
In hindsight, this is how it should have been in the first place, since it's the same thing Linux distributions do. They (used to?) place *.csh files too for sourcing from /etc/csh.login.
Sep 27 2022
Sep 27 2022
Since a similar effect can be obtained by having the shell ignore the signal via trap '' TTOU, I'm not sure it's a good idea to add an option for this.
Fine with me to add this to make some compiler/linter happy, even though non-static array bounds in parameters don't really do anything.
Sep 25 2022
Sep 25 2022
Sep 9 2022
Sep 9 2022
Oh, the unset obviously defeats the purpose. Defending against someone copying /etc/profile to /usr/local/etc/profile without leaving stray variables in the user's environment is a little harder.
Aug 19 2022
Aug 19 2022
In D35836#823357, @pstef wrote:@jilles is this patch in a good shape now?
Aug 4 2022
Aug 4 2022
Jul 23 2022
Jul 23 2022
This should have testcases.
Jul 22 2022
Jul 22 2022
Thanks, I have also encountered this issue.
Jul 19 2022
Jul 19 2022
In D35840#814030, @pstef wrote:In a way, this has nothing to do with bash. I want sh PS4 to be able to generate some kind of timestamps when executing a script with tracing on. The way bash does it is just a convention which I think is not worth diverging from.
Jul 18 2022
Jul 18 2022
jilles added inline comments to D35588: bsdinstall: allow setting the root password via env variables.
A little unfortunate to have these strange backslash sequences spread out further, but it's nothing that bash doesn't do.
Jun 12 2022
Jun 12 2022
jilles committed rG5dd1f6f14416: utimensat(2): Remove description of compatibility code (authored by pluknet).
May 26 2022
May 26 2022
May 21 2022
May 21 2022
Apr 20 2022
Apr 20 2022
POSIX indeed leaves this behavior unspecified, but Linux chooses the same as we do. Might want to add something like
POSIX leaves the behavior of .Fn sigtimedwait with a .Dv NULL .Fa timeout pointer unspecified.
to the STANDARDS section.
Apr 10 2022
Apr 10 2022
Apr 3 2022
Apr 3 2022
Apr 2 2022
Apr 2 2022
Mar 27 2022
Mar 27 2022
Mar 14 2022
Mar 14 2022
jilles added inline comments to D34544: sh: fix autocompletion for commands that share name with a directory.
Mar 13 2022
Mar 13 2022
jilles requested changes to D34544: sh: fix autocompletion for commands that share name with a directory.
Mar 9 2022
Mar 9 2022
Mar 8 2022
Mar 8 2022
Feb 11 2022
Feb 11 2022
Jan 26 2022
Jan 26 2022
In D21939#769857, @allanjude wrote:Interestingly, chroot() no longer requires root privileges. Does that change things here?
Jan 23 2022
Jan 23 2022
Jan 14 2022
Jan 14 2022
Oct 27 2021
Oct 27 2021
Oct 26 2021
Oct 26 2021
Oct 24 2021
Oct 24 2021
Oct 5 2021
Oct 5 2021
Oct 1 2021
Oct 1 2021
Sep 22 2021
Sep 22 2021
I agree that OPTIND=1 is needed, but I have another reason for it. POSIX requires that a script set OPTIND=1 between using different sets of parameters with getopts; otherwise, the results are unspecified.
OK. Thanks for the reminder.
Sep 17 2021
Sep 17 2021
Sep 8 2021
Sep 8 2021
This is more consistent, and probably more useful (while read loops tend not to treat EOF and read errors differently).
Aug 28 2021
Aug 28 2021
OK, but perhaps this fix should be in libedit instead. The same issue can be seen in other libedit clients such as ftp(1).