Can anyone help me to understand why this works?
Code:
df -h | awk '/Mounted on/{ split($6,a," "); print a[1]}'
Mounted
But this outputs nothing?
Code:
df -h | awk '/Mounted on/{ split($6,a," "); print a[2]}'
I would have expected to show 'on'.
This, on the other hand, works, if applied on the whole line:
Code:
df -h | awk '/Mounted on/{ split($0,a," "); print a[7]}'
on