Comments in command-line Zsh

Having just started trying out zsh, I ran into this problem too. You can do setopt interactivecomments to activate the bash-style comments.

The Z Shell Manual indicates that while this is default behavior for ksh (Korn shell) and sh (Bourne shell), and I am guessing also for bash (Bourne-again shell), it is not default for zsh (Z shell):

In the following list, options set by default in all emulations are marked <D>; those set by default only in csh, ksh, sh, or zsh emulations are marked <C>, <K>, <S>, <Z> as appropriate.

INTERACTIVE_COMMENTS (-k) <K> <S>
Allow comments even in interactive shells.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)