I have two Files (.csv) say File1.csv
and File2.csv
with 'INVALID'
records, generated at the end of a Informatica Job.
I am using below command to search for the file names 'INVALID'
, and then if either of the file has 'INVALID'
records I have to mail that particular file and if both has invalid records, both the files has to be mailed to the user.
$ grep -il "invalid" File1.csv File2.csv | xargs -I'{}' uuencode {} | mailx -s"files" mymail@gmail.com
I am getting mail with two files attached but with no records.
I also tried using -a to attach the file:
$ grep -il "invalid" File1.csv File2.csv | xargs -I'{}' mailx -s"files" -a {} mymail@gmail.com
But the above command is throwing error:
mailx: illegal option -- a
Usage: mailx -eiIUdFntBNHvV~ -T FILE -u USER -h hops -r address
-s SUBJECT -f FILE users