Hi All.
I have a simple script that calculates line count in a file and sends an email with the file as an attachment.
The issue I have is ,I want to subtract 1 from the line count .
Noflines=`wc -l $1 |cut -c1-8`
ans=(($Noflines-1)
echo $ans
the script is not executing at line 2..ans=
I think this is because iam subtracting integer from a string.is that true.what can i change here to make this work.
can someone please help me out.
Thanks ,Ron
I have a simple script that calculates line count in a file and sends an email with the file as an attachment.
The issue I have is ,I want to subtract 1 from the line count .
Noflines=`wc -l $1 |cut -c1-8`
ans=(($Noflines-1)
echo $ans
the script is not executing at line 2..ans=
I think this is because iam subtracting integer from a string.is that true.what can i change here to make this work.
can someone please help me out.
Thanks ,Ron
Comment