![]() ![]() Whenever column 3 ($3) contains the word "Capacity" ($3~/Capacity), it runs the command "c=$5", which stores the fifth column into an array (a box) labelled with the contents of the third column. ![]() This awk command starts by reading in each line of ioreg -l, one at a time. The printf command calculates $10/$5*100 (that is, the 10th column divided by the 5th column, times 100) and prints it as a floating-point number with 2 decimal places ("%.2f") followed by a percentage sign ("%%").Īwk '$3~/Capacity/ ' (So $5 is the 5th column's data and $10 is the 10th column's). This first awk command reads the standard input, one line at a time (if necessary I'm guessing only one line is being sent to it here), and splits the line into columns, the data in column c having the name $c. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |