TRIM spaces in shell

am get a value like ' 15' in a variable

what is the easiest method i can follow to strip 15 out

Scroll to the bottom of this page to the Similar Threads section. The posts there should help you.

echo |$CHECK|

CHECK=`printf "%d"$CHECK`
echo $CHECK

the result was
| 15|
15

it worked :cool:

You can use "tr" command with -s option to truncate the space with the string !!
use: man tr for your reference !!

Thanks !!