It might be different when run as a script (with a separate shell process) to when run as an explicit loop in an interactive shell, or a shell function.
It might be different when run as a script (with a separate shell process) to when run as an explicit loop in an interactive shell, or a shell function.