[LDAPsh-devel] Enhanced redirection
Status: Beta
Brought to you by:
rcorvalan
From: Rafael C. <Raf...@li...> - 2003-09-19 19:45:43
|
Hi, After some of code reviewing, testing and resolving conflicts ;-), I applied the patch proposed by James for enhanced redirection. Redirection is still difficult to understand, I think, for someone that does not know internals... Mainly due to filehandles lifetime. When you use "redir('| something')", you have to understand that if "something" is a command "flow based", it works as everyone expects. If "something" must wait that the input filehandle is closed before printing anything, some people may not understand. Example: redir '| grep last' will work as everyone expects redir '| wc' will not output anything until a noredir() is typed, because "wc" is a command that needs to know the whole input to print anything. And since the filehandle is still open, the "wc" command is still "alive". We have 2 options: 1) That's what we expect 2) We expected an output at each command, in which case we must open the filhandle '| wc' at each command. I don't have the answer... For me both are good. By the way, redir() is quite broken, because command line parsing is very simple. For example: cat 'cn=3Dtest' | grep -i last will give an error. This is not 100% a problem of redir. It's also a command line parsing problem. If someone knows a package that handle this issue better than we do, please let me know... Cheers, Rafael |