__stdin.d(2): Error: found End of File when expecting }

Andre Pany andre at s-e-a-p.de
Wed Jul 17 19:05:20 UTC 2019


Hi,

this scripts throws 2 times this error:
__stdin.d(2): Error: found End of File when expecting } following 
compound statement
__stdin.d(2): Error: found End of File when expecting } following 
compound statement

```
#!/bin/bash

text="
import std;

void main()
{
     while(true)
     {
         string enemy1 = readln().strip;
         int dist1 = to!int(readln().strip);

         string enemy2 = readln().strip;
         int dist2 = to!int(readln().strip);

         // Write an action using writeln()
         writeln(dist1 > dist2 ? enemy2 : enemy1);
         // Enter the code here
     }
}"

curl -fsS https://dlang.org/install.sh | bash -s dmd-2.087.0
source ~/dlang/dmd-2.087.0/activate
echo $text | dmd -
```

what is here wrong?
( I execute it using on Ubuntu 18.04 LTS using WSL)

Kind regards
André


More information about the Digitalmars-d-learn mailing list