tdenniston / bish

Bish is a language that compiles to Bash. It's designed to give shell scripting a more comfortable and modern feel.
MIT License
1.48k stars 36 forks source link

bish -r does not work when script requires stdin input to be forwarded #69

Open akalsi87 opened 8 years ago

akalsi87 commented 8 years ago

Here is a snippet that works correctly when run as a standalone bash script but fails in bash -r:

def readline() {                                                                                                                                   
    y = @(exec head -n 1 -)                                                                                                                        
    return "$y"                                                                                                                                    
}

val = readline()
println("Got $val")

This seems to me to be because of run_on in bish.cpp.

I propose we create a temporary file somewhere and run it using system rather than trying to mimic the semantics of this.

Thoughts?

I'd be willing to fix this issue.