I know nothing about nagios, but supposing you understand what grep
is doing, the rest is:
sed
(stream editor) is s
ubstituting (erasing) all white spaces for nothing (or a white space, whatever is between the second and third slash '//'), including tabs and linebreaks (this is what [:space:]
stands for), g
lobally. This combines to 's/[[:space:]]//g'
The result goes to cut
, that will use as delimiter (set with -d
) slashes "/" and will select and print only field (-f
) 5.
By the way, use code function when showing posting codes to StackOverflow, makes easier to read and answer (for instance, I do not know if you wrote 's/[[:space:]]//g'
or 's/[[:space:]]/ /g'
just from looking).