intervals and apply() in  shell()