i don't agree that a small program is in order. this is the type
of thing that is often done by hand, once. that's why god gave
us the shell. ;-)
i was thinking about this this am (before i'd read all the email
on the subject). perhaps this would be better:
<>[1,2] /net/dns { echo google.com ip ; cat >[1=2] }
or this should work currently
<> /net/dns { @{ >[1=0] echo gogole.com ip} ; cat }
i like your suggestion, but i think that real variables would be
much better than creating a special namespace for file descriptors.
(how would they survive a fork, for instance. that's sure to come
up.) the other problem is how to deal with the syntax. the
syntax for redirection is already tricky.
on the subject of rc, i think there are a few other improvements
that whould clean up the language a bit. for instance
- a `` operator like byron's rc. as in
y = 'a b c'
x = ``(' ' ' ') {echo $y}
whatis y
y=(a b c)
there are other ways to do this which might be better. but
the basic problem in rc is that it's often difficult to set ifs right
where you need it and it ends up interfering with something else
- here documents could be removed. quoting is simple enough;
embedding a document by quoting. and here documents don't
work in functions. (this would require a small change to how tok
is handled.)
On Sat Mar 18 06:35:58 CST 2006, [EMAIL PROTECTED] wrote:
> i had a strange dream about something like ...
>
> > <>[?]/net/dns { echo google.com ip >[1=?1]; cat <[0=?1] }
>
> (just like \1, \2 etc in sam - change '?' to whatever you like.)
>
> in this case the first construct would do an open and the
> result may be 4 or 104 but "?1" will know. and then it's over,
> as dup() is good for the rest. it handles nesting and sequencing
> if you think about it.
>
> using fds beyond "i have one open so let's do some file-ops
> with it" is foolish. both srv and ssl break this and hence can't
> fit in (can't be imported or exported). writing a number (relevant
> only to the requesting machine) doesn't work from remote.
>
> check out the amusing error messages.
>
> brucee
>
> On 3/18/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > > well it's a horrible ad-hoc hack. do you expect it to work?
> >
> > It was before my first cup of coffee and I could not resist the
> > temptation. The ";" complaint isn't yet clear to me, however.
> >
> > ++L
> >
> >