[comp.sys.amiga.tech] Plus

ben@epmooch.UUCP (Rev. Ben A. Mesander) (11/16/90)

>In article <7054@sugar.hackercorp.com> peter@sugar.hackercorp.com (Peter da Silva) writes:
>In article <ben.3416@epmooch.UUCP> ben@epmooch.UUCP (Rev. Ben A. Mesander) writes:
>> One more thing I'd like to inject into the pipe discussion is that the '+'
>> mechanism is not unique to the 'run' command. You can use it after
>> any command, and it will load the command and wait for you to press enter.
>
>A good question, I hope, since I have RTFM and I still can't figure it out...
>
>How do you access the stuff the user types in after the +?

Huh?!? Either you're not making sense, or I'm not making myself clear... :-)

Try this: 

Pretend you have a 1-drive system.
cd to your workbench volume. 
type: 'dir +'
insert a different disk in the same drive.
press enter.
you get a directory listing....

What I meant was to not mess this up if you start messing with the 
meaning of '+' with your piping scheme.

Am I making sense?

>Peter da Silva.   `-_-'

--
| ben@epmooch.UUCP   (Ben Mesander)       | "Cash is more important than |
| ben%servalan.UUCP@uokmax.ecn.uoknor.edu |  your mother." - Al Shugart, |
| !chinet!uokmax!servalan!epmooch!ben     |  CEO, Seagate Technologies   |

peter@sugar.hackercorp.com (Peter da Silva) (11/16/90)

In article <ben.3416@epmooch.UUCP> ben@epmooch.UUCP (Rev. Ben A. Mesander) writes:
> One more thing I'd like to inject into the pipe discussion is that the '+'
> mechanism is not unique to the 'run' command. You can use it after
> any command, and it will load the command and wait for you to press enter.

A good question, I hope, since I have RTFM and I still can't figure it out...

How do you access the stuff the user types in after the +?
-- 
Peter da Silva.   `-_-'
<peter@sugar.hackercorp.com>.

new@ee.udel.edu (Darren New) (11/17/90)

In article <7054@sugar.hackercorp.com> peter@sugar.hackercorp.com (Peter da Silva) writes:
>How do you access the stuff the user types in after the +?

If I remember properly, you have to look directly at the command line,
and the plusses are replaced by newlines of some sort (\r, \n, or whatever).
That is, in Lattice you need to use _main instead of main. My machine is
down right now, or I would double check this.    -- Darren
-- 
--- Darren New --- Grad Student --- CIS --- Univ. of Delaware ---
----- Network Protocols, Graphics, Programming Languages, 
      Formal Description Techniques (esp. Estelle), Coffee, Amigas -----
              =+=+=+ Let GROPE be an N-tuple where ... +=+=+=

pete@violet.berkeley.edu (Pete Goodeve) (11/17/90)

In  <7054@sugar.hackercorp.com> (16 Nov),
Peter da Silva (peter@sugar.hackercorp.com) writes:
> In article <ben.3416@epmooch.UUCP> ben@epmooch.UUCP (Rev. Ben A. Mesander) writes:
|>  One more thing I'd like to inject into the pipe discussion is that the '+'
|>  mechanism is not unique to the 'run' command. [....]
>
> A good question, I hope, since I have RTFM and I still can't figure it out...
>
> How do you access the stuff the user types in after the +?

...and in  <36574@nigel.ee.udel.edu> (16 Nov),
Darren New (new@ee.udel.edu) replies:
>
> If I remember properly, you have to look directly at the command line,
> and the plusses are replaced by newlines of some sort (\r, \n, or whatever).
> That is, in Lattice you need to use _main instead of main. My machine is
> down right now, or I would double check this.    -- Darren

I did check, and that's right: with (Lattice) _main you get the COMPLETE
command input (minus the plusses, but plus the commandname itself).

On the same lines, I thought it would be cute to try for a prototype "PIPE"
command in ARexx.  Sure enough, if you do "parse args argin"/"say argin",
you nicely get the complete input text.

One problem... ARexx seems to have no concept of newlines!  I can find NO
way to parse argin into single lines.  Anyone know of one?

                                            -- Pete --

lphillips@lpami.wimsey.bc.ca (Larry Phillips) (11/18/90)

In <1990Nov17.093417.7937@agate.berkeley.edu>, pete@violet.berkeley.edu (Pete Goodeve) writes:
>I did check, and that's right: with (Lattice) _main you get the COMPLETE
>command input (minus the plusses, but plus the commandname itself).
>
>On the same lines, I thought it would be cute to try for a prototype "PIPE"
>command in ARexx.  Sure enough, if you do "parse args argin"/"say argin",
>you nicely get the complete input text.
>
>One problem... ARexx seems to have no concept of newlines!  I can find NO
>way to parse argin into single lines.  Anyone know of one?

There are a few ways to do this. One is to use the pos() or index() functions
within a substr() function to split out the individual lines. You will find it
easiest to assign the hex string to a variable, especially if the newline or CR
is part of another string. The other way I can think of is to use a translate()
function. Translate() allows you to translate more than one thing at a time, so
you can translate all spaces to some unused character, and at the same time,
translate all newlines or CRs to spaces. You can then split the lines on a word
basis, and translate the special characters back to spaces.

-larry

--
The only things to survive a nuclear war will be cockroaches and IBM PCs.
+-----------------------------------------------------------------------+ 
|   //   Larry Phillips                                                 |
| \X/    lphillips@lpami.wimsey.bc.ca -or- uunet!van-bc!lpami!lphillips |
|        COMPUSERVE: 76703,4322  -or-  76703.4322@compuserve.com        |
+-----------------------------------------------------------------------+

ben@epmooch.UUCP (Rev. Ben A. Mesander) (11/18/90)

>In article <1990Nov17.093417.7937@agate.berkeley.edu> pete@violet.berkeley.edu (Pete Goodeve) writes:
>
>On the same lines, I thought it would be cute to try for a prototype "PIPE"
>command in ARexx.  Sure enough, if you do "parse args argin"/"say argin",
>you nicely get the complete input text.
>
>One problem... ARexx seems to have no concept of newlines!  I can find NO
>way to parse argin into single lines.  Anyone know of one?
>

Yes, use the '|' character surrounded by whitespace to indicate the end of
every line... (ducking :-)

>                                            -- Pete --

--
| ben@epmooch.UUCP   (Ben Mesander)       | "Cash is more important than |
| ben%servalan.UUCP@uokmax.ecn.uoknor.edu |  your mother." - Al Shugart, |
| !chinet!uokmax!servalan!epmooch!ben     |  CEO, Seagate Technologies   |