This is an sed expression that was created by a contributor here. More specifically by @craig-sanders.
$FileToMove is set to "2012-09-01 Home insurance quote_zz20.pdf"
# use sed to extract folder number from filename. FolderNo=$(echo "$FileToMove" | sed -r -e 's/.*zz([0-9]+)\.pdf/\1/') # On my Mac, I figured that this command needs to be FolderNo=$(echo "$FileToMove" | sed -E -e 's/.*zz([0-9]+)\.pdf/\1/')
The above command is used to extract "20" from the name of the file. Now I want to replace zz20 with null.
Been trying to do it. Will learn sed and before that need to learn regular expressions. In the meantime, I am sure it is super easy to replace it with null. Any tips?