zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@sunsite.dk
Cc: 517008@bugs.debian.org
Subject: Re: Bug#517008: alias not expanded with zsh -c
Date: Wed, 25 Mar 2009 11:11:28 -0700	[thread overview]
Message-ID: <090325111130.ZM7836@torch.brasslantern.com> (raw)
In-Reply-To: <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.).

-- 


  reply	other threads:[~2009-03-25 18:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20090225022850.GA4841@vin.lip.ens-lyon.fr>
2009-03-25 14:54 ` Clint Adams
2009-03-25 16:30   ` Peter Stephenson
2009-03-25 17:25     ` Peter Stephenson
2009-03-25 18:11       ` Bart Schaefer [this message]
2009-03-25 18:20         ` Peter Stephenson
2009-03-26  0:14           ` Bart Schaefer
2009-03-26  9:50             ` Peter Stephenson
2009-03-26 15:12               ` Bart Schaefer
2009-03-26 15:18                 ` Peter Stephenson
2009-03-25 23:35         ` Vincent Lefevre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=090325111130.ZM7836@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=517008@bugs.debian.org \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).