Many bash scripts invoke the
#character to indicate a comment. Catalina migrated to zsh. The command:
# Comments should elicit no response
zsh: command not found: #
I find useful command examples on the web: it is helpful to annotate commands with said #weblink so that it is captured in the history.
I did find this post: https://stackoverflow.com/a/11873793/4953146
- Is there a reason for the
#not to be recognized as the comment character in zsh?
- How can the terminal be configured to recognize the character as a comment?
Question 1 sets the context for deciding on a method to address question 2. It would nice to be able to configure the character once and all future instances of zsh would follow. If there is / was a good reason why the feature was disabled, I would like to understand any reasons.
Understanding the 'why' is important to determine the 'how'. There seems to be many ways to restore
# commenting in zsh. One durable solution is to add to the configuration file:
sudo vi /etc/zshrc:
Other methods (not durable) include invoking ksh or sh.
Many thanks to user3439894 & Allan for supporting / advancing the question.