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

Re: coproc tutorial (Re: questions)



Chris Hansen wrote:

> #!/bin/zsh -i
> 
> coproc /usr/bin/nslookup
> 
> while true; do
> 	TEST=">"
> 	NSLOUT=" "
> 	while [[ $TEST != $NSLOUT ]] ; do
> 		print -n $NSLOUT
> 		read -pk NSLOUT
> 	done
> 	read 'QUERY?>'
> 	print -p $QUERY
> done

3.1.6-pws-something (at least the latest pws-6) has Functions/Misc/nslookup
which uses `vared' to read the user input, thus allowing command line
editing. Together with the new completion system this function will
also give you completion *inside* nslookup (and not only nslookup's
arguments).

To workers: seems like noone found this interesting enough to improve
the code I hacked up. Maybe sometime we could write a generic function 
for this task...

Bye
 Sven


--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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