Re: simple alias doesn't work



In article <1159353644.759316.96570@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
bpatton@xxxxxx wrote:

I'm running on a linux box and trying to get this simple alias to
function
alias tvim "xterm -e vim $* &"

I want it to pop a new xterm with the vim editor open.
example input
$ tvim a b c d

A new xterm opens with vim and 4 files in vim's buffers.

The correct syntax for the alias in tcsh is:

alias tvim 'xterm -e vim \!:* &'

Aliases use history substitution to process their arguments, not shell
parameter syntax. Also, since you used doublequotes instead of
singlequotes, $* was expanded at the time that you defined the alias,
rather than when you used it.

--
Barry Margolin, barmar@xxxxxxxxxxxx
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
.



Relevant Pages

  • Re: simple alias doesnt work
    ... $ tvim a b c d ... A new xterm opens with vim and 4 files in vim's buffers. ... alias tvim='xterm -e vim $@' ...
    (comp.unix.shell)
  • Re: Creating an Alias
    ... Then you should put then in the .profile file in your home directory. ... Here is an alias to make 'll' actually run 'ls -l': ... run's the shell as a login shell. ... For an xterm this means running ...
    (comp.unix.shell)
  • xterm: how to open a new xterm and run telnet
    ... following alias to create a xterm window and then do telnet. ... I want execute telnet command with xterm so that i don't have to type ...
    (comp.unix.shell)
  • Re: knode: fonts appear double-spaced.
    ... >> I see double spaced fonts when I start xterm. ... What determines whether I am trying to use it as an anti-aliased font? ... I don't know if UXTerm is relevant for me. ... # Alias between XLFD families and font file family name, ...
    (Debian-User)
  • Re: xterm: how to open a new xterm and run telnet
    ... 2004-01-30, 00:54, ajay: ... > This works fine if i issue this command from the command line. ... > when i put into alias it doesn't work. ... Note the "resource" mechanism in the xterm man page if you don't ...
    (comp.unix.shell)