[NCLUG] bash alias
Eric Brunson
brunson at level3.net
Wed Oct 17 17:17:25 MDT 2001
It's because the $1 isn't being evaluated at all.
Read the section of the bash man page on aliases.
* joshua at fitsnips.net (joshua at fitsnips.net) [011017 17:07]:
> This is really odd. I assumed it would be:
>
> alias "xm=xemacs $1 &"
>
> but that does not work. Now if I leave off the: &
> the substitution works great. Would love to see how
> you guys solve this one. Also anyone know why adding
> & on the end changes the command?
>
> Joshua
>
>
>
> Quoting "Aaron D. Johnson" <adj at ccltd.com>:
>
> > In message <15310.1310.289581.54060 at harrier.ftc.agilent.com>, Daniel
> > Herrington writes
> > > I use tcsh most of the time. I have an alias for xemacs so that I can
> > > just type "xe <file>" and it starts xemacs and puts it in the
> > > background. The alias I use for this is the following:
> > >
> > > alias xe 'xemacs \!* &'
> > >
> > > How would I do the same thing in bash?
> >
> > I'd do:
> >
> > xe () { xemacs $* & }
> >
> > Which makes xe a shell function rather than an alias, but it works
> > just the same.
> > _______________________________________________
> > NCLUG mailing list
> > NCLUG at nclug.org
> > http://www.nclug.org/mailman/listinfo/nclug
> >
>
> For blessings of Liberty to ourselves and our posterity. -- Constitution of the United States of America
> Liberty -- A right or immunity to engage in certain actions without control or interference
> -------------------------------------------------
> Have you visited http://www.fitsnips.net today?
> _______________________________________________
> NCLUG mailing list
> NCLUG at nclug.org
> http://www.nclug.org/mailman/listinfo/nclug
--
Eric Brunson brunson at level3.net page-eric at level3.net
tcA thgirypoC muinelliM latigiD eht detaloiv tsuj evah uoY
More information about the NCLUG
mailing list