The code in my post above seems to be missing bits.... Attached is the script I use as a file. If you still have problems it might be worth using another folder to hold your scripts; anything under MyDocs is on the 32GB drive which is a FAT32 format and so cannot be given execute permissions. I use /home/user/scripts as for my bash scripts.