Am stuck, and on something really stupid.

using Cygwin on Windows 8, Quick Bash script to search server for files modified in the past 120 days: Run once a week as a Cron job, But i cannot format the email.

All i want is a simple New Line:

data=$(find /cygdrive/g/SERVERPATH -mtime -120 -name "*.exe"  -exec stat -c "%n : %y" {} \;) ; [[ -n "$data" ]] && email -s 'Servers Latest Files' EMAIL@DOMAINNAME.COM <<< "The following files have been detected as updated in the last 120 days <br> $data"

$Data Search from Grep. All i want is to new Line between text and $Data

I tried using Echo -e or printf with no luck. using simple /r does not work.

is it a matter of defining the email as HTML format and passing through
as i am currently doing?

up vote 0 down vote accepted

I answered my own question. Simply writing down, normally dummys it enough for my brain to click in.

Pass HTML option and just use HTML formatting:

email -html -s

So for a working example:

data=$(find /cygdrive/g/SERVERPATH -mtime -120 -name "*.exe"  -exec stat -c "%n : %y" {} \;) ; [[ -n "$data" ]] && email -html -s 'Servers Latest Files' EMAIL@DOMAINNAME.COM <<< "The following files have been detected as updated in the last 120 days <br> $data"

Sorry for posting this and wasting ones times

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.