zsh-users
 help / color / mirror / code / Atom feed
* aliases not getting expanded inside functions?
@ 2003-01-03 15:31 Carlos Carvalho
  2003-01-03 15:39 ` Zefram
  2003-01-03 15:45 ` Phil Pennock
  0 siblings, 2 replies; 16+ messages in thread
From: Carlos Carvalho @ 2003-01-03 15:31 UTC (permalink / raw)
  To: zsh-users

Hi users,

First, thanks Bart for the info on the C preprocessor bug.

Now I'm trying to do something like

% alias -g foo='bar'
% escr() {print $foo}

I'd expect that since the alias is global, comes before the definition
of the function, and aliases are expanded when a function is read,
that the function would be in effect {print $bar}, but it isn't:

% which escr
escr () {
        print $foo
}

The "problem" is with the $, because if I write {print foo} instead of
{print $foo} in the definition the function appears as {print bar}, as
I expected. Is this correct? If so, is there a way to achieve this
substitution? This is in a script, not interactive.

Thanks in advance.


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2003-01-14 11:45 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-03 15:31 aliases not getting expanded inside functions? Carlos Carvalho
2003-01-03 15:39 ` Zefram
2003-01-03 15:45 ` Phil Pennock
2003-01-03 17:24   ` Carlos Carvalho
2003-01-03 17:44     ` Phil Pennock
2003-01-03 18:10       ` Carlos Carvalho
2003-01-03 18:54         ` Zefram
2003-01-06  8:29           ` Carlos Carvalho
2003-01-06 12:54             ` Bart Schaefer
2003-01-11  3:19               ` Carlos Carvalho
2003-01-11 18:40                 ` Bart Schaefer
2003-01-13 17:59                   ` Carlos Carvalho
2003-01-13 18:48                     ` Bart Schaefer
2003-01-13 21:40                       ` Carlos Carvalho
2003-01-14  5:10                         ` Bart Schaefer
2003-01-14 11:44                           ` Roman Neuhauser

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).