Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

7
  • 2
    Long dead version of Bash is buggy, news at 11. Jokes aside, FWIW, I can repro on a centos:5 docker container, which has 3.2.25(1), but not on a centos:6 container, which has 4.1.2(2). I'm betting this was a bug fixed with 4.0 or 4.1. Commented Nov 21, 2023 at 12:03
  • 1
    What are the values of $HISTIGNORE on the two machines? Does one of them include #*? Commented Nov 21, 2023 at 12:56
  • @terdon: unset on both -- but HISTIGNORE is about saving in history, which both machines do. The problem is that the mac doesn't load commented commands from history. Commented Nov 22, 2023 at 18:59
  • I think @muru already answered the question, maybe add that as the answer muru? Commented Nov 22, 2023 at 18:59
  • OK. I just tried with HISTIGNORE="#*" and then ran #foo and pressing the UP button didn't bring it back. And it seems reasonable that it can't load something if it hasn't saved it. In any case, if it is indeed a bug in an old bash version, there's not much more to add. Commented Nov 22, 2023 at 19:05