I am trying to download two files, A and B, using curl in a Makefile. The download of A has to be finished to download B.
When I am executing the following command in zsh, the order is respected (B is being downloaded after A):
curl -o ./A.html https://myserv.com/script.php?file=A && \
curl -o ./B.html https://myserv.com/script.php?file=B
But when I put the same command in my Makefile, B and A are being downloaded concurrently:
all:
curl -o ./A.html https://myserv.com/script.php?file=A && \
curl -o ./B.html https://myserv.com/script.php?file=B
I don't understand why? Any idea?
&&implies, but that's not how you describe your requirements. If that's not a requirement then simply using two separate commands would be natural.marc_s. Thanks to him, the makefile is not syntactically correct anymore.&&operator, and assuming the shell is POSIX, the two files shall download sequentially, not concurrently. From the POSIX standard: The control operator&&denotes an AND list. The format shall be:command1 [ && command2] ...Firstcommand1shall be executed. If its exit status is zero,command2shall be executed, and so on, until a command has a non-zero exit status or there are no more commands left to execute. What shell executes the recipes? Could it be that it is not POSIX?