I am new to creating .sh files (and bash scripting) and I am trying to create a script that would read, rename an copy files to a folder with appropriate name, but do not know how to go around this. I was hoping one of you could point me to the right direction. 

This is my start (still some errors in it)

```
 #!/bin/bash
for i in 'find /temp_pdf -type f | xargs grep *.pdf'; #loop for findg all .pdf files residing in temp_pdf
do
#1234 invoice.pdf
directory=${i:0:4}; # read the first 4 chars of the file name
#cp 1234 invoice.pdf /copy/1234*
cp $i /copy/$directory*; #copy the the file to /copy/xxxx* folder
done;

```