Hello and thanks for all the fish ;-).  It fits my dreams for the
perfect shell almost exactly.
One example for powerful orthogonality that I always wanted to have
was to remove the repetition between similar process substitution
commands.  This is frequently useful with diff:

$ diff <(cd DIR1; find -type f -print0 | xargs -0 md5sum) <(cd DIR2;
find -type f -print0 | xargs -0 md5sum)

"psub" is just a command which prints a filename, solving it neatly (*):

> diff (for d in DIR1 DIR2; cd $d; find -type f -print0 | xargs -0 md5sum | 
> psub; end)

But what about input substitutions:

$ foo --log >(sendmail me -) --output >(wput ftp://my -)

While less frequently needed, they are still desirable.  One simple
syntax I can think of is (psub <command>):

> foo --log (psub sendmail me -) --output (psub wput ftp://my -)

This will more-of-less work because if psub is running the command it
can steal stdout for printing the pipe filename.  But then the program
can't output to the terminal - it must be redirected to /dev/null or
something like that.  Part of this problem is that pipelines won't
work:

foo --output (psub sort | sendmail me -)

This can't work because we want the output of psub.  Any ideas?
Devilish thought: perhaps "psub command" should print the pipe name to
stdin?  We need to tell the command substitution to use stdin
somehow...

(*) An unrelated problem: it only works for absolute dirs.  I see no
anolog to bash's "(...)" running code in a sub-process (begin..end is
run in the same shell).  How can I change directories temporarily? 
It's easy to write a "subshell" command but to be convenient it should
accept pipelines, blocks and loops -- so we need a builtin?

--
Beni Cherniavsky <[EMAIL PROTECTED]>, who can only read email on weekends.
Governments are like kernels - everything possible should be done in user space.
N�HS^�隊X���'���u��<�ڂ�.���y�"��*m�x%jx.j���^�קvƩ�X�jب�ȧ��m�ݚ�����v&��קv�^�+����j�Z����{az����^��h��஋�n���)��{h�����ا�׫�+h�(m�����Z��jY�w��ǥrg

Reply via email to