View Single Post
Posts: 2,802 | Thanked: 4,491 times | Joined on Nov 2007
#39
Originally Posted by locusf View Post
I'm using this code:
Code:
PROD=$(cat /proc/component_version | grep product | cut -d" " -f 6)
Nitpicking: you don't really need cat, and the cut part could be a bit fragile as it relies on the amount of whitespace remaining constant. How about something like:

Code:
PROD=$(grep product /proc/component_version)
PROD=${PROD##* }
 

The Following User Says Thank You to lma For This Useful Post: