i have below code to count number of rows in file1.txt, if the row count is more than one then i have sending an email along with file1.txt attached and fail the process(do nothing if count is <=1),
if I test individually count part works good but when i include the email part its not working, couldn't figure out the issue, is the approach correct or is there a better way for this approach
#! /usr/bin/ksh
Attachment = file1.txt
Number_of_lines = wc -l < file1.txt
Email_Id=abc@email.com
if [ $Number_of_lines > 1 ] then
(echo "Find Attached the Error File which list the Error Rows from Invalid Procedure codes";uuencode $Attachment Invalid_Procedure_Codes.txt) | mail -s "[ERROR] : Invalid Procedure codes " $Email_Id
fi