Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Is this correct? Redirecting stdin/stout to implement a gdb-like "set inferior tty" in zshdb
- X-seq: zsh-users 13549
- From: Stephane Chazelas <Stephane_Chazelas@xxxxxxxx>
- To: Rocky Bernstein <rocky.bernstein@xxxxxxxxx>
- Subject: Re: Is this correct? Redirecting stdin/stout to implement a gdb-like "set inferior tty" in zshdb
- Date: Tue, 9 Dec 2008 12:12:13 +0000
- Cc: Zsh users list <zsh-users@xxxxxxxxxx>
- In-reply-to: <6cd6de210812090327o11abb9f3w2cc932515e4dbef8@xxxxxxxxxxxxxx>
- Mail-followup-to: Rocky Bernstein <rocky.bernstein@xxxxxxxxx>, Zsh users list <zsh-users@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <6cd6de210812090327o11abb9f3w2cc932515e4dbef8@xxxxxxxxxxxxxx>
On Tue, Dec 09, 2008 at 06:27:48AM -0500, Rocky Bernstein wrote:
[...]
> exec 7<&0 </dev/null 6>&1 # Line taken from an autoconf "configure" script.
> #...
> exec {_Dbg_fdi} <> $1
> while : ; do
> vared -e -h -p "foo> " line <&${_Dbg_fdi} || break
The thing is read doesn't read from fd 0 (not does it write its
prompt or the echoed and controlling characters to fd 0, 1 or 2)
but from/to a fd that was open to the attached terminal upon
start and some that's some fd over 10 so probably hard to
redirect (if I use strace here, I see it reads and writes to fd
11).
You may want to consider the "clone" feature:
info --index-search=clone zsh
> builtin print -- "$line" >&${_Dbg_fdi}
ITYM
print -r -- "$line"
> line=''
> done
> echo "That's all folks! (${_Dbg_fdi})"
>
> Does zsh have <> like ksh does? It wasn't rejected, so I assume it does.
[...]
<> was Bourne already (though I beleive early versions had
issues with it), so it should be recognised by every Bourne-like
shell.
--
Stéphane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author