This isn't quite perfect for what you want, but I think it might get you closer. Quicksilver has a command line tool. When installed, you can pipe files from the command line to Quicksilver app, and from there send them as attachments in Mail.
To install Quicksilver command line tool, activate Quicksilver. Then navigate to Quicksilver > Preferences to open preferences window. Click on Preferences on top right of window. On the left, click on Command Line Tool and install.
In Terminal, you'll be able to type
qs path/to/file1 path/to/file2 path/to/file3 path/to/file4
Pressing enter will send those files to Quicksilver's first pane. Press tab to move to the action pane and choose the Mail/New Email With Attachment action. Press enter, and a new email with your selected files attached should appear.
Note that you will also have to install the Mail and Command Line plugins in Quicksilver (Quicksilver > Preferences > Plug Ins).
So, does it matter if the file is the same file?
ie: Let say there is a picture google.png
and you want it to copied into the same dir 4 times.
as an in that directory you would have
google.png google 2.png google 3.png google 4.png?
If thats what you want:
for i in {1..4}
do
cp google.png "google$i.png"
done
But if you want the "images" files to be different, and they are going to be gibrish files, but 10m in size exactly
you wanna do something like
for i in {1..5}
do
dd if=/dev/random of="yourfilename$i.test" bs=12428800 count=1
done
This will make four files that are 10m in size filled with bunch of random characters.
Comment and let me know what you really want and I can go back and redo this.
It would help if you posted your script that fails so I can see what youre trying to do.
EDIT:
Changed the in device from /dev/zero to /dev/random to generate random file content.
Best Answer
The following script works but it needs to open (and close) a Finder window.
Save this to
maccopy
:and
chmod +x maccopy
.Use with
maccopy PATH-TO-FILE
.