John Levon wrote: > On Wed, Feb 21, 2007 at 04:16:17PM +0000, Frank Hofmann wrote: > >>>>> http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mdb/common/mdb/mdb_print.c#1446 >>>> Can this be overridden ? >>>> >>>> If '/...' operates on the first instead of the last output work, it breaks >>>> the old example: >>>> >>>> *log_recentq::print queue_t q_first | ::walk b_next | ::walk b_cont | >>>> ::print mblk_t b_rptr | /s >>>> >>>> if an '-a' is inserted after the '::print'. >>> I do not see this as inconsistent. There is no point to -a in such a case >>> unless you want the address. Just don't use -a! >> It does make a difference. The following: >> >> *rootvfs::print -a vfs_t vfs_data | ::print ufsvfs_t >> *rootvfs::print -a vfs_t vfs_data | ::print -a ufsvfs_t >> *rootvfs::print vfs_t vfs_data | ::print ufsvfs_t >> *rootvfs::print vfs_t vfs_data | ::print -a ufsvfs_t >> >> all do the same on 'classical' but with the new are different. > > I'm not denying the behaviour has changed, just that the new behaviour is > both useful and self-consistent. > >> Imagine longer pipes with ::print in. > > What's the difference? When would you have previously found -a useful in such > a > case? Given that the thing it changed was always ignored? > >> And the documentation on pipes, so that it mentions "watch what you put to >> the left side of a '|'". > > You've lost me. It's always the case that the behaviour on the right side of a > pipe is dependent on what happens on the left side of a pipe. I can't imagine > any concept of a pipe where that isn't true. >
And the behaviour of the command on the left (depending on the specific command), can and does change depending on whether its output is to a pipe. Various commands adjust themselves in the DCMD_PIPE_OUT case to make themselves useful to pipes where otherwise they would not be. I don't see how ::print -a is any different here... -- Rich