Open lyonsquark opened 9 years ago
Yes, I tried it a while ago on OS X and failed to run bash code. I do not know why, though. It will be great if you can help me investigate this issue, since I do not use OS X very often.
Thanks for your reply, Yihui, I did some experimentation, running code similar to your bash "server" reading from a named pipe that I would echo to from another bash session. Named pipes must be very finicky in OSX. Everything I tried failed most of the time, except every now and then it would work once or twice. I was able to improve things by using the bash builtin "read" command (reads only one line) and adding short sleeps (like 0.1 seconds). I was able to make that pretty reliable, but reading one line at a time makes building up the command you want to run difficult. In fact it seems impossible since "read" discards stuff past the first line. I'll play around some more and let you know what I figure out.
Thanks! How about using a socket server/client (e.g. http://hacktux.com/bash/socket) instead of named pipes? I have not tried utilities like nc
(netcat) so I really do not know if they will work at all.
Yes - I think sockets are the way to go. Looking into that...
I think I have a working solution using sockets. Trying a few more things.
That sounds perfect! Thanks a lot! :+1:
I think I've figured things out and sockets work fine on my Mac. I submitted a pull request to you with the changes. Please try them on Linux (or whatever you use) and let me know what happens. -- Adam
Oops - didn't mean to close the issue :-)
Ahh - sorry about using "tmp" - that was less than smart of me. Thanks for fixing it. -- Adam
Hi - I'm having trouble with the persistent bash feature. For example,
A subsequent attempt at
b$exec(...)
will hang.I'm running OSX Mavericks. Have you seen this behavior? Thanks! -- Adam