Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug#517008: alias not expanded with zsh -c
- X-seq: zsh-workers 26791
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: Bug#517008: alias not expanded with zsh -c
- Date: Wed, 25 Mar 2009 11:11:28 -0700
- Cc: 517008@xxxxxxxxxxxxxxx
- In-reply-to: <20090325172509.79c53d4d@news01>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20090225022850.GA4841@xxxxxxxxxxxxxxxxxxx> <20090325145418.GB9330@xxxxxxxx> <200903251630.n2PGU8sK013449@xxxxxxxxxxxxxx> <20090325172509.79c53d4d@news01>
On Mar 25, 5:25pm, Peter Stephenson wrote:
} Subject: Re: Bug#517008: alias not expanded with zsh -c
}
} > Yes, at least as far as native zsh mode goes this isn't a bug.
}
} I should also have pointed out that the "emulate sh" doesn't make any
} difference, it only takes effect after the string for -c has already been
} parsed---it's basically the same issue as the alias expansion one itself.
It's my recollection that the discussion of this on the austin-group list
led to the conclusion that zsh's native behavior in this case is within
the allowed variation in the POSIX spec. Vincent, if you're reading this,
do you disagree, and can you point out why?
My personal feeling is that aliases are an interactive convenience that
should never be used in scripts (including "sh -c") in the first place.
} You would need to start the shell in the appropriate mode. I don't think
} that's an unreasonable requirement.
Especially considering that now you can do
emulate sh -c "..."
which is admittedly a little clumsy to use as in
zsh -c 'emulate sh -c "..."'
but nevertheless is available to get the desired effect.
} Is the fix as simple as the following? This is not a trick question, I
} could very easily have missed something.
Will this cover "emulate -c"?
I'm a bit leery of even starting down this road, because it still fails
to make any difference if the alias definition and use are on the same
line (separated with ";" or "&&" etc.).
--
Messages sorted by:
Reverse Date,
Date,
Thread,
Author