Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: DEBUG_CMD_LINE (Was Re: PATCH: skip command from debug trap)



On Thu, Aug 07, 2008 at 11:14:38AM +0100, Peter Stephenson wrote:
[...]
> > BTW, shouldn't PROMPT_SUBST be enabled by default in sh and ksh
> > emulation?
> 
> If they do that, then presumably yes.
[...]

It's required by SUSv3 for non-priviledged users for systems
supporting the User Portability Utilities option (so include the
sh of Unix conformant systems, but not necessarily POSIX
conformant ones I suppose).

> > Is there a way to run shell code (other than assignments and
> > arithmetic expansion) upon the expansion of PS4? I thought of
> > /(e:code:), but in scalar context I couldn't find a way for
> > globbing to be performed.
> 
> I don't see how this differs from the stuff in $(...), which is treated as
> a complete command line.  Do you mean you need code to run within
> the current shell?
[...]

Yes, sorry, I forgot the most important part of my sentence,
"without forking a subshell", or as you put it: "within
the current shell" but I suppose it's not easy to determine what
the current shell is when PS4 is expanded (especially in
pipe-lines).

The idea behind it being another way to have a DEBUG trap.

-- 
Stéphane



Messages sorted by: Reverse Date, Date, Thread, Author