FOR statement should block nshell execution until loop completes

Signed-off-by: nigel <nigel.cook@hp.com>