Timeline for Problem with data comparison in if loop
Current License: CC BY-SA 3.0
9 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Sep 21, 2015 at 10:43 | comment | added | YoMismo | Weird, if I do a x="03 " and after that I do a echo $(($x+1)) I am returned 4. I guess what you have after the number is some special character. Anyway, I'm glad you solved it. | |
| Sep 21, 2015 at 10:40 | comment | added | stany | finally!!! it had trailing space..so trimmed it...gosh!! | |
| Sep 21, 2015 at 10:31 | comment | added | YoMismo | if you awk'd the result getting 749 (awk -F, '{print $2}') it still gives you errors? I don't see the need for that comma. | |
| Sep 21, 2015 at 10:22 | comment | added | stany | I sort of narrowed down on the problem. the last row of file usually contains ###,749 from this i am extracting the ###,749 If i put a , (comma) after 749, it works | |
| Sep 21, 2015 at 10:19 | comment | added | YoMismo | @stany I must be missing something... Is the problem that ACTUAL_ROW_COUNT sometimes returns a number and sometimes returns a string? in that case, you have to process that variable before you compare it. | |
| Sep 21, 2015 at 10:05 | comment | added | stany | i echoed both values. both have same value. In my example, ACTUAL_ROW_COUNT is string. I tried ACTUAL_ROW_COUNT=expr $ACTUAL_ROW_COUNT + 0 , but it gives me "expr: non-numeric argument" error. | |
| Sep 21, 2015 at 9:47 | comment | added | YoMismo | @stany could you echo the values before the if? what values do $a and $b have before the if loop? | |
| Sep 21, 2015 at 9:38 | comment | added | stany | I tried this. It did not work for me. | |
| Sep 21, 2015 at 8:51 | history | answered | YoMismo | CC BY-SA 3.0 |