Search Results

Search: Posts Made By: everurs789
4,239
Posted By Scrutinizer
Try this awk -F'[()]' '/CURDEPTH/ &&...
Try this
awk -F'[()]' '/CURDEPTH/ && $4+0>200{exit 1}' test1.txt || mailx -sBut it seems the format of you file is not consistent. What is on these other lines, that do not produce a number?
4,239
Posted By tukuyomi
<deleted> Sorry, I did not read correctly :/ ...
<deleted>
Sorry, I did not read correctly :/
You receive a mail because $4 is not always a value, therefore, exit 1 is always executed.
If it's not too long/confidential, what does cat file...
4,239
Posted By Scrutinizer
Hi Anurag, it means OR . The command on the right...
Hi Anurag, it means OR . The command on the right hand side only gets executed if the left hand side is false. So if the script has return code 0 then there is no mail, but if it returns 1 then a...
4,239
Posted By Scrutinizer
awk -F'[()]' '/CURDEPTH/ && $2>10{exit 1}'...
awk -F'[()]' '/CURDEPTH/ && $2>10{exit 1}' test1.txt || mailx -s ...
4,239
Posted By anurag.singh
depth=$(awk 'BEGIN{FS="(\(|\))"} /CURDEPTH/{if($2...
depth=$(awk 'BEGIN{FS="(\(|\))"} /CURDEPTH/{if($2 > 10){print $2;p=1;exit}}END{if(!p) print 0}' test1.txt)
if [ $depth -gt 10 ]; then
mailx -s "Your Mail Subject" EMAIL_ID < mail_body_file
fi
Showing results 1 to 5 of 5

 
All times are GMT -4. The time now is 02:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy