Article 52HCR [SOLVED] awk split shows nothing

[SOLVED] awk split shows nothing

by
vincix
from LinuxQuestions.org on (#52HCR)
Can anyone help me to understand why this works?
Code:df -h | awk '/Mounted on/{ split($6,a," "); print a[1]}'
MountedBut 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]}'
onlatest?d=yIl2AUoC8zA latest?i=N766T1S3tlI:KLYWGlPi0fw:F7zBnMy latest?i=N766T1S3tlI:KLYWGlPi0fw:V_sGLiP latest?d=qj6IDK7rITs latest?i=N766T1S3tlI:KLYWGlPi0fw:gIN9vFwN766T1S3tlI
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments