RFR 8179856: jshell tool: not suitable for pipeline use

Robert Field robert.field at oracle.com
Tue Sep 12 19:53:25 UTC 2017


I like it!

Both because it is clean and a standard.
I agree that considering stdin exhausted (so exiting after) makes sense.

It will mean somewhat of a rewrite, but that’s fine.

I’ll redo and send out.

-Robert

> On Sep 12, 2017, at 8:47 AM, Jan Lahoda <jan.lahoda at oracle.com> wrote:
> 
> What would happen if we processed "-" (stdin) as a file? One difference I see is that after processing the files, the interactive shell is started unless there is an explicit /exit in the files. But given we have already processed the stdin, it would seem OK to me to not start the interactive part (there's an EOF at the end of the stdin, I assume, which for stdin could be seen as an explicit /exit).
> 
> I also tried bash:
> $ echo 'echo X' | bash -
> X
> 
> Jan
> 
> On 11.9.2017 18:35, Robert Field wrote:
>> 
>> On 09/11/17 02:30, Jan Lahoda wrote:
>>> Hi Robert,
>>> 
>>> Overall seems OK to me. One question: why use "--pipe" instead of
>>> simply "-" (which is AFAIK common option for "read stdin")?
>> 
>> From Linux "cat" -----
>> 
>> SYNOPSIS
>>        cat [OPTION]... [FILE]...
>> 
>> DESCRIPTION
>>        ...
>> 
>>        With no FILE, or when FILE is -, read standard input.
>> 
>> EXAMPLES
>>        cat f - g
>>               Output f's contents, then standard input, then g's contents.
>> 
>>        cat    Copy standard input to standard output.
>> 
>> ------------
>> 
>> The jshell tool always reads from standard in (unless somehow aborted).
>> This "--pipe" argument is an option, whereas "-" in the *nix world is a
>> file.
>> 
>> The option does not change what is read, but how it is processed.
>> 
>> But maybe that is too pedantic, and it still the natural choice.
>> 
>> Thoughts?
>> 
>> -Robert
>> 
>> 
>>> 
>>> Jan
>>> 
>>> On 24.8.2017 06:35, Robert Field wrote:
>>>> Please review --
>>>> 
>>>> Bugs:
>>>> 
>>>>     8179856: jshell tool: not suitable for pipeline use
>>>>     https://bugs.openjdk.java.net/browse/JDK-8179856
>>>> 
>>>>     8186708: jshell tool: bad load file garbles message and does not
>>>> abort
>>>>     https://bugs.openjdk.java.net/browse/JDK-8186708
>>>> 
>>>> Webrev:
>>>> 
>>>>     http://cr.openjdk.java.net/~rfield/8179856v1.webrev/
>>>> 
>>>> Thanks,
>>>> Robert
>>>> 
>> 



More information about the kulla-dev mailing list