• Accessing args in csh/tcsh aliases (Was: Unsettling bash tutorial)

    From Kenny McCormack@3:633/10 to All on Monday, March 16, 2026 02:41:32
    In article <n1p6njFnv3tU3@mid.individual.net>,
    rbowman <bowman@montana.com> wrote:
    On Sun, 15 Mar 2026 23:20:30 -0000 (UTC), Kenny McCormack wrote:

    Yeah, aliases in bash are a real foo-up, because they can't
    (meaningfully)
    take parameters. It would have been better (IMHO) not to have had them
    in the language at all. Note that the syntax for accessing alias
    parameters in [t]csh is totally weird, but it does work.

    Not that weird in the context of sed, awk, Perl, and so forth.

    I think you are implying that the args would be accessed as $1, $2, etc, as
    is the case in (Bourne-ish) shells and AWK (and others...).

    But that's not how it works in csh/tcsh. The args to an alias are accessed
    via a weird syntax like \!:2 for the second arg.

    --
    In politics and in life, ignorance is not a virtue.
    -- Barack Obama --

    --- PyGate Linux v1.5.13
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)