Also, simplify syntax (no need for a loop). Also, actually propagate error from all commands.
Attach a file by drag & drop or click to upload