Mail attachment from Unix script in loop

Multi tool useMail attachment from Unix script in loop
I have below sample script which was working fine until last week, however, not sure what has changed, I am not getting any attachments sent. I just get greet / text message but not any attachment. I tried with sample .txt as attachment which is success. But not .csv, not sure if csv's are being filtered by unix server, but I don't see any error message. Any idea how to track / check what is going wrong pls?
#!/bin/bash
FILES=/inbox/*.*
to="test@temp.com"
from="test@temp.com"
subject="Test Files"
filecount=`find $FILES -type f | wc -l`
totalfiles=" : Total "
subject=${subject}${totalfiles}${filecount}
body="Dear All,Please find the attached latest files."
echo $subject $filecount
declare -a attargs
for att in $(find $FILES -type f -name "*.*");do
#attaching all files.
attargs+=( "-a" "$att" )
done
mail -s "$subject" -r "$from" "${attargs[@]}" "$to" <<< "$body"**
Kind Regards
Kevin
subject="..."
echo $subject $filecount
FILES=/inbox/*.*
find
*.*
FILES
-name
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.
2G9alhEU8zc
Popular posts from this blog
PHP contact form sending but not receiving emails I have created a contact form using PHP to send the data. The form seems to send fine as there are no errors and success message appears, however I am not receving the emails into the designated inbox. I am using PHPMailer as I originally tried just using the php 'mail' command which I now understand is a bit hit and miss. I cannot see why I would not be receving the emails so I would be very grateful for any help that could be given. I'm quite new to PHP so please be patient with me :) <?php use PHPMailerPHPMailerPHPMailer; use PHPMailerPHPMailerException; $msg = ""; if (isset($_POST['submit'])) { require 'phpmailer/src/Exception.php'; require 'phpmailer/src/PHPMailer.php'; require 'phpmailer/src/SMTP.php'; function sendemail ($to, $from, $body) { $mail = new PHPMailer(true); $mail->setFrom($from); $mail->addAddress($to); $ma...
Do graphics cards have individual ID by which single devices can be distinguished? I have several graphics cards of the same manufacturer and same model and I want to distinguish them not only by the pcie socket they reside in but by some individual value I can read from the hardware. Is there such value and if so what would it be called and how could I access it? Right now I'm using modern nvidia cards (10xx series) and nvidia inspector.but I'd prefer if there was any value that was also applicable to amd. I have programming and scripting knowledge. I am running Windows 10 1 Answer 1 This is a powershell example to pull information from video cards. The DeviceID is supposed to be unique but only if the manufacturer supports Windows Display Driver Model (WDDM). (I copied this directly from docs.microsoft.com) $strComputer = "." $colItems = get-wmiobject -class "Win32_VideoC...
Create weekly swift ios local notifications I can create daily notifications but not weekly ones using swift 3 ios 10 User Notifications framework. Daily works fine but when I add in the .weekday parameter it doesn't send me a notification. The code is: for i in 1 ... 7 { let center = UNUserNotificationCenter.current(); let content = UNMutableNotificationContent(); content.title = "Title"; content.body = "content"; content.sound = UNNotificationSound.default(); var dateComponents = DateComponents(); dateComponents.weekday = i; // hours is 00 to 11 in string format if (daynight == "am") { dateComponents.hour = Int(hours); } else { dateComponents.hour = Int(hours)! + 12; } // mins is 00 to 59 in string format dateCom...
1, need quotes around
subject="..."
. 2,echo $subject $filecount
will be redundant since filecount is already assigned in subject. 3,FILES=/inbox/*.*
but it's never used anywhere except as afind
target, so you don't need the*.*
both inFILES
and the-name
argument to find. (unless there are files that don't meet the . spec, you don't need it at all.) I doubt any of thise will fix your problem, but cleaning up is usually a good place to start.– Paul Hodges
Jul 2 at 18:31