bash crashes on SIGPIPE

2015-04-14 Thread Nikola Kržalić
If I open a socket to local database: exec 3 /dev/tcp/127.0.0.1/6379 In netstat I can see the connection successfully established: tcp0 0 127.0.0.1:42662 127.0.0.1:6379 ESTABLISHED 2269/-bash And then I proceed to send some data: echo -e *2\r\n$3\r\nGET\r\n$6\r\nmy_key\r\n

Re: bash crashes on SIGPIPE

2015-04-14 Thread Eduardo A . Bustamante López
You can trap SIGPIPE and handle it. -- Eduardo Bustamante https://dualbus.me/

Re: bash crashes on SIGPIPE

2015-04-14 Thread Andreas Schwab
Nikola Kržalić nik...@krzalic.com writes: And if I decide to run echo again, bash simply crashes. It is not a crash, it is the correct behaviour. Don't try to write to a broken pipe. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5

Re: bash crashes on SIGPIPE

2015-04-14 Thread Chet Ramey
On 4/14/15 2:46 PM, Nikola Kržalić wrote: I wonder if this is the correct behavior in interactive bash as well? Because if I do this via ssh my connection drops as well and I have to reconnect. Shouldn't just echo return a non-zero exit code? Bash doesn't perform any special handling on

Re: bash crashes on SIGPIPE

2015-04-14 Thread Nikola Kržalić
I wonder if this is the correct behavior in interactive bash as well? Because if I do this via ssh my connection drops as well and I have to reconnect. Shouldn't just echo return a non-zero exit code? On Tue, Apr 14, 2015 at 7:26 PM, Andreas Schwab sch...@linux-m68k.org wrote: Nikola Kržalić