I have a bash script that I am converting .jpg files, zipping them, then (because of the destination limitations), breaking the zip file into smaller chunks. I end with a series of files like this:
eab_ph01.zip
eab_ph02.zip
eab_ph03.zip
eab_ph04.zip
eab_ph05.zip
eab_ph06.zip
eab_ph07.zip
eab_pho1.zip
eab_photos.zip
Or, it is possible the files will look like this:
eab_pho1.zip
eab_pho2.zip
eab_pho3.zip
eab_pho4.zip
eab_pho5.zip
eab_pho6.zip
eab_pho7.zip
I am able to select the specific files, whether it uses the prefix pho or ph with the following regular expression
ls | grep -P "eab_pho?[0-9]?[0-9]?.zip"
Then I need to start an SFTP session. I need to PUT only the segmented files and not get the original file eab_photos.zip.
How can I include the regular expressions to put the specific files that I want?