Hacker News new | ask | show | jobs
by nojhan 4755 days ago
You use the "zero or more" * operator, which will match empty strings in front of the "%". But an empty string cannot be converted to a float. Just use the "at least one" operator: +. Also, the scale is 0,100 by default, you can omit it.

    df -h | colout "([0-9]+)%" scale
1 comments

Thanks for the response. My lazy regex makes me feel bad.