• Use of "alias" in .tcshrc Failing?

    From JHawkins@JHawkins@HumanitiesSoftware.Com to comp.sys.mac.misc,comp.sys.mac.system,comp.unix.shell on Friday, July 11, 2003 00:04:25
    From Newsgroup: comp.sys.mac.system

    Hi,

    In my .tcshrc file, I first add a directory to my $path. This works, so I
    know the file is being called. Then, I am trying to make an alias that
    should turn text files into scripts, then move them to my ~/bin, then rehash
    so that the command is immediately available.

    The line is:
    alias makescript 'chmod 755 !*;mv !* ~/bin;rehash'

    On starting a shell, the result is:
    0: Event not found

    "man tcsh" info on alias does not indicate much about how to use it, and
    there is no entry for "man alias". Can anyone tell me what might be wrong
    here?

    Thanks!
    --
    Jeffrey A. Hawkins


    --- Synchronet 3.18b-Win32 NewsLink 1.113
  • From kbkwk@kbkwk@mac.invalid to comp.sys.mac.misc,comp.sys.mac.system,comp.unix.shell on Thursday, July 10, 2003 21:56:42
    From Newsgroup: comp.sys.mac.system

    In article <danPa.94554$Io.8131030@newsread2.prod.itd.earthlink.net>, <JHawkins@HumanitiesSoftware.Com> wrote:

    Hi,

    In my .tcshrc file, I first add a directory to my $path. This works, so I know the file is being called. Then, I am trying to make an alias that
    should turn text files into scripts, then move them to my ~/bin, then rehash so that the command is immediately available.

    The line is:
    alias makescript 'chmod 755 !*;mv !* ~/bin;rehash'

    On starting a shell, the result is:
    0: Event not found

    "man tcsh" info on alias does not indicate much about how to use it, and there is no entry for "man alias". Can anyone tell me what might be wrong here?

    Thanks!
    --
    Jeffrey A. Hawkins



    You need to quote the !'s, i.e.,

    alias makescript 'chmod 755 \!*;mv \!* ~/bin;rehash'
    --- Synchronet 3.18b-Win32 NewsLink 1.113
  • From Kiran@kiran@no.spam to comp.sys.mac.misc,comp.sys.mac.system,comp.unix.shell on Friday, July 11, 2003 05:31:07
    From Newsgroup: comp.sys.mac.system

    <JHawkins@HumanitiesSoftware.Com> wrote:
    alias makescript 'chmod 755 !*;mv !* ~/bin;rehash'

    You don't want !* to be interpreted when this command is read, only
    when it is executed. To protect it during the first pass, use \!*
    instead.
    alias makescript 'chmod 755 \!*;mv \!* ~/bin;rehash'
    --- Synchronet 3.18b-Win32 NewsLink 1.113