e-mail script

Hi there,

Just wondering if anyone can help me with a unix script that will allow to check if a file is in a directory and if it is then e-mail it to someone and then move the file to another directory.

I have come up with nothing right now and was hoping someone could get the ball rolling for me.

Thanks heaps

Well, typically you'll get more help if you get the ball rolling, and ask about specific areas :slight_smile:

A few hints, though:
man test
man (your shell here - look for the "if" statements in the page)
man mail

Also a hint: You can use "here-docs" for mail - I use this method:

/usr/bin/mail my.address@example.com <<EOF
Subject: Hello
Importance: Low

This is my body. Above is the header.

.
EOF

Play with it, and post back if you have any specific problems...