Search Results

Search: Posts Made By: madhavb
1,674
Posted By madhavb
Awk product of nth field
How do I do the product of nth filed just like sum. For sum I know like
awk '{ sum += $12 } END {printf "%.2f\n", sum}'
works as initial sum = 0.

But for product how do initialize the variable...
2,163
Posted By madhavb
egrep output order
The order of egrep output seems to be as they occur in the file. How do I get the order as requested? For e.g.


file contents:
AAA
EEE
GGG

egrep 'GGG|AAA|EEE' file

gives
AAA
...
Showing results 1 to 2 of 2

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