Re: Anomaly

2016-09-25 Thread Chet Ramey
On 9/20/16 11:04 PM, PePa wrote: > When sourcing this script (version 1), it will print y after receiving > an interrupt, but not in the 2 different versions (2 and 3). > > # version 1 > echo x > sleep 99 > echo y > > # version 2 > echo x; sleep 99 > echo y > > # version 3 > echo x > sleep 99;

Anomaly

2016-09-21 Thread PePa
When sourcing this script (version 1), it will print y after receiving an interrupt, but not in the 2 different versions (2 and 3). # version 1 echo x sleep 99 echo y # version 2 echo x; sleep 99 echo y # version 3 echo x sleep 99; echo y Is this a bug or expected behaviour?? Thanks for your

bash and sshd trap anomaly

2016-03-10 Thread Olof Schonbeck
Hi In a small bash script we have a trap to cleanup some files when exiting. You run the script by ssh to the machine in question and execute the script. If your ssh session dies the trap should trigger and clean up the files as the script exit but this doesn't happen. I apologize that

read -t 0 anomaly

2013-10-04 Thread Kunszt Árpád
I tried to use read -t 0 to check if there is any data on the STDIN or not. The man page said: If timeout is 0, read returns success if input is available on the specified file descriptor, failure otherwise. Maybe I made a mistake but I tested and I got variable results: arpad@terminus ~ $

Re: read -t 0 anomaly

2013-10-04 Thread Pierre Gaston
On Fri, Oct 4, 2013 at 2:20 PM, Kunszt Árpád arpad.kun...@syrius-software.hu wrote: I tried to use read -t 0 to check if there is any data on the STDIN or not. The man page said: If timeout is 0, read returns success if input is available on the specified file descriptor, failure

Re: read -t 0 anomaly

2013-10-04 Thread Kunszt Árpád
On 2013. October 4. 14:51:00 Pierre Gaston wrote: On Fri, Oct 4, 2013 at 2:20 PM, Kunszt Árpád ... There is a race condition, you cannot know if echo will run before read. I see, and it's logical. But this stills confuses me. arpad@terminus ~ $ for(( i=0; i10; i++ )); do echo -n | {

Re: read -t 0 anomaly

2013-10-04 Thread Pierre Gaston
On Fri, Oct 4, 2013 at 3:08 PM, Kunszt Árpád arpad.kun...@syrius-software.hu wrote: On 2013. October 4. 14:51:00 Pierre Gaston wrote: On Fri, Oct 4, 2013 at 2:20 PM, Kunszt Árpád ... There is a race condition, you cannot know if echo will run before read. I see, and it's logical. But

Re: read -t 0 anomaly

2013-10-04 Thread Pierre Gaston
On Fri, Oct 4, 2013 at 3:29 PM, Pierre Gaston pierre.gas...@gmail.comwrote: On Fri, Oct 4, 2013 at 3:08 PM, Kunszt Árpád arpad.kun...@syrius-software.hu wrote: On 2013. October 4. 14:51:00 Pierre Gaston wrote: On Fri, Oct 4, 2013 at 2:20 PM, Kunszt Árpád ... There is a race

Re: read -t 0 anomaly

2013-10-04 Thread Pierre Gaston
On Fri, Oct 4, 2013 at 3:30 PM, Pierre Gaston pierre.gas...@gmail.comwrote: On Fri, Oct 4, 2013 at 3:29 PM, Pierre Gaston pierre.gas...@gmail.comwrote: On Fri, Oct 4, 2013 at 3:08 PM, Kunszt Árpád arpad.kun...@syrius-software.hu wrote: On 2013. October 4. 14:51:00 Pierre Gaston