I have a line of output from a command like this:
[]$ <command> | grep "Memory Limit"
Memory Limit: 12345 KB
I'm trying to pull out the 12345. The first step - separating by the colon - works fine
[]$ <command> | grep "Memory Limit" | cut -d ':' -f2
12345 KB
Trying to separate this is what's tricky. How can I trim the whitespace so that cut -d ' ' -f1
returns "12345" rather than a blank?