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;
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
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
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 ~ $
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
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 | {
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
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
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