HP3000-L Archives

July 2007, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Roy Brown <[log in to unmask]>
Reply To:
Roy Brown <[log in to unmask]>
Date:
Fri, 6 Jul 2007 16:59:57 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (62 lines)
In message <[log in to unmask]>, okappert <[log in to unmask]> 
writes
>Roy:
>
>I am not sure this is what you need but try "|" as the pipe action.
>
>Regards, Olav.

Thanks Olav, but it was John Korb who was asking.

Piping might well be helpful to him though.

I realised later that there was an omission in what I wrote; my first 
option needs 'echo' - if indeed it will work at all, it won't work as I 
showed it.

Here's the corrected version:

=====================================================

  Taking one invocation of PHP, above:

  c:\php\php.exe [php_script_name] 
[?_something_to_tell_DOS_stdin_data_follows]
  [line_0_of_data]
  [line_1_of_data]
  [line_2_of_data]
  ...
  [line_n_of_data]
  [eod_mark-though_it_was_ctrl_z]

  can you invert and extend this, thus:

  echo [line_0_of_data] > tempfile
  echo [line_1_of_data] >> tempfile
  echo  [line_2_of_data] >> tempfile
  echo ...                      >> tempfile
  echo [line_n_of_data]  >> tempfile

  c:\php\php.exe [php_script_name] < tempfile

and you may or may not need:

  echo  [eod_mark (some convention, perhaps ctrl_z]  >> tempfile

depending on whether you need something to tell the invocation of php 
to quit or not - if it's a variable number of line, you probably will, 
though).

This can all still be done on the fly, but requires the php invocation 
to follow, not precede, the data, and for the 'echo' and the ' >(>) 
tempfile' to be  appended to each data line.

====================================================

-- 
Roy Brown        'Have nothing in your houses that you do not know to be
Kelmscott Ltd     useful, or believe to be beautiful'  William Morris

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2