The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 01-03-2009
cfajohnson's Avatar
cfajohnson cfajohnson is offline Forum Advisor  
Shell programmer, author
  
 

Join Date: Mar 2007
Location: Toronto, Canada
Posts: 2,373

You can use shell parameter expansion to extract what you want. E.g.:


Code:
temp=$( sensors | grep 'CPU Temp:' )
temp=${temp##*/}


Last edited by Neo; 01-03-2009 at 11:46 PM.. Reason: Changed wording