I'm using the following in my script.
if echo $cpuidle |/usr/bin/egrep [0-9][0-9]; then
when I issue this statement it issues the value of the variable back to stdout which ends up in my output file.
Is there a better way to write this?
I'm using ksh on solaris 9.
I don't know if I understand what you want, but couldn't you use the -q (quiet) option to suppress writing to stdout?
anbu23
3
if echo $cpuidle | grep -q [0-9][0-9]; then
If you don't have -q option then use this
echo $cpuidle | grep [0-9][0-9] > /dev/null
if [ $? = 0 ]; then
I had to use /usr/xpg4/bin/grep to get the -q option.
thanks, that works!