bash - shell script for awk print divide value with 1024 -


I am trying to do some arithmetic operations on the awk output process. My sample file contains a string and it is counting now that I am trying to make the count value in the MB format (defualt count will come in bytes.)

Example: myfile.txt

  a 123455 b 34455566 C 10394934839 d 102445555  

My script:

  cat myfile.txt | While reading the line; Name = $ line; Name = `echo $ fname | Awk '{print $ 1} ``; Cnt = 'echo $ fname | Awk '{print $ 1} ``; If [$ cnt -gt 1024]; Then echo "Value of $ name in important $ cnt";  

Problem: I need to change the CNT value to MB (CNT / 1024/1024).

There is no clue how to achieve this

You can do this (Net bash):

  $ cat myfile.txt | While reading l; Repeat what $ $$ ((f / 1024/1024)); If [$ ((f / 1024/1024)) -gt 1024]; Then echo "$ l value in important"; Important D 97  
in the first 0b 32 c 9913c value

Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -