• !: a bad idea (Was: The angle bracket in an echo command???)

    From Kenny McCormack@21:1/5 to ivan@siamics.netNOSPAM.invalid on Thu Jun 15 21:39:20 2023
    XPost: alt.msdos.batch

    In article <u6fvb9$hdk2$1@dont-email.me>,
    Ivan Shmakov <ivan@siamics.netNOSPAM.invalid> wrote:
    ...
    It's also possible to disable history substitution altogether
    with 'set +H'.

    I believe this behavior is rather confusing to new users, and
    given that C-r (reverse-search-history) and cursor keys already
    offer a comparable feature, and one likely to fit better with
    user's prior experience at that, my suggestion would be to
    have it disabled by default.

    I agree. The ! thing was brought over into bash from (t)csh and it is
    pretty universally a bad idea. In fact, the rules for how it is handled
    are even more confusing in bash than they are in (t)csh. I can never tell
    from looking at it whether or not it is going to try to trigger a history expansion or not.

    I may do as you suggest and disable it globally in my bash shells.

    --
    People sleep peaceably in their beds at night only because rough
    men stand ready to do violence on their behalf.

    George Orwell

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Kenny McCormack on Fri Jun 16 00:07:07 2023
    XPost: alt.msdos.batch

    On 2023-06-15, Kenny McCormack <gazelle@shell.xmission.com> wrote:
    In article <u6fvb9$hdk2$1@dont-email.me>,
    Ivan Shmakov <ivan@siamics.netNOSPAM.invalid> wrote:
    ...
    It's also possible to disable history substitution altogether
    with 'set +H'.

    I believe this behavior is rather confusing to new users, and
    given that C-r (reverse-search-history) and cursor keys already
    offer a comparable feature, and one likely to fit better with
    user's prior experience at that, my suggestion would be to
    have it disabled by default.

    I agree. The ! thing was brought over into bash from (t)csh and it is
    pretty universally a bad idea.

    Do you remember There was a period in the 1990's when tcsh was widely
    used? It was popular among early Linux users, too. I remember
    getting a default login shell as tcsh on some systems, having
    to change it with chsh.

    It hink this was a spill-over effect of csh use on proprietary Unix
    systems; people coming from that finding an equivalent in tcsh.

    Bash aping some tcsh features (even not so good ones) probably helped
    wean people off that.

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Axel Reichert@21:1/5 to Kaz Kylheku on Fri Jun 16 07:22:14 2023
    Kaz Kylheku <864-117-4973@kylheku.com> writes:

    Do you remember There was a period in the 1990's when tcsh was widely
    used? It was popular among early Linux users, too. I remember
    getting a default login shell as tcsh on some systems

    Yes. At that time I was not familiar with the existence of two different
    shell languange families and got quickly used to !$, !*, and !0, which have entered my command line repertoire permanently.

    Best regards

    Axel

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)