Pattern: Use of time
with compound command
Issue: -
time
is only defined for Simple Commands by POSIX. Timing loops, command groups and similar is not.
Example of incorrect code:
time for i in *.bmp; do convert "$i" "$i.png"; done
Example of correct code:
time sh -c 'for i in *.bmp; do convert "$i" "$i.png"; done'
None. If you use a shell that supports this (e.g. bash, ksh), specify this shell in the shebang.