On Mon, 01 Mar 1999 19:17:40 GMT, Barry Margolin
>>I would like to read and process the lines from a file redirected into
>>the script, that is processing the lines, but I have tried without
>>luck.
>It should show up as the script's standard input. File redirection
>automatically connects the file to the process's standard input.
>>If for example the script is invoked like this:
>> thescript < theinputfile
>>I would like to process the lines (not a binary input file) either one
>>line at a time or the file as a hole:
>> while read line
>> do
>> process theline
>> done
>That should work. What problem have you had?
My problem is that I don't see the output on the tty ie. I would like
to copy my input, redirected from another program to the users current
tty:
echo theline > `tty`
Quote:>>or
>> cp thefile anotherfile
>I'm not sure what you mean by this. What does this have to do with
>redirected input? Do you mean:
> cp theinputfile anotherfile
>If so, you can do that with:
> cat > anotherfile
>The "cat" command will read its standard input, which is connected to
>theinputfile because of the redirection, and copy it to its standard
>output, which is redirected to anotherfile.
I have tried this too but with out any luck. The script is simple;
1) instruct the terminal emulator that it should grap the the terminal
output and direct it to the users local printer (is working)
2) redirect the input to terminal (cat > `tty`)
3) instruct the terminal emulator that it should no longer grap the
the terminal output and direct it to the users local printer (is
working)
the script is working if the inputfile is a parameter to script and I
reference $1 but this is not how the implementation must work!
-
Henrik
-
:Lynnerup Data
:Henrik Lynnerup
:lynnerup_at_post9.tele.dk