I can't understand the following behavior of sem
from GNU Parallel.
When I use single quotes, it seems to work well:
sem -j1 'echo $(date);sleep 5;echo $(date)'
sem --wait
gives
Sat Apr 23 15:46:50 EDT 2016
Sat Apr 23 15:46:55 EDT 2016
However, when I use double quotes.
sem -j1 "echo $(date);sleep 5;echo $(date)"
sem --wait
the result is
Sat Apr 23 15:46:08 EDT 2016
Sat Apr 23 15:46:08 EDT 2016
where it seems that the sleep 5
is totally ignored.
Could anyone explain why this happens? Is it caused by GNU parallel or bash?