![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Covert Channels Evaluation Framework 0.1 (Default branch) | iBot | Software Releases - RSS News | 0 | 05-21-2008 09:40 PM |
| Standard Data Sets for CEP/IDS Evaluation | iBot | Complex Event Processing RSS News | 0 | 08-01-2007 03:50 AM |
| equation calculation on Unix | robbinGlasses | UNIX for Dummies Questions & Answers | 4 | 11-16-2006 07:13 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
AWK equation evaluation.
Hi,
Is there a way to evaluate an equation contained in a string within an AWK script? For example: A = "(5*2)-1" (this equation is read from a file and varies line by line) In this example, I can't see any way to get an answer of 9 unless I do: cmd = "awk 'BEGIN{print "A"}'" cmd | getline A The above method works fine but it's rather slow when dealing with large files! Does anybody know of a better way of achieving the same result within the main AWK script? Any help and advice appreciated. Steve |
|
|||||
|
something educational to read up on....
|
|
||||
|
Quote:
Thanks for your help! The modified calc3 code does exactly what I want and is 15 times faster than the method I was using! |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|