question about cat in script

hi all
i have some script
echo $$ > process-id
d='cat process-id'
if test-s "TMP"$d then
echo "serv1"
else
echo "serv2"
fi
the variable d should contain the number of the process,
instead of that it contains 'cat process-id'
how shall i do that the d will contain only the number?
thanks in advance

try doing a:

[code]
d=`echo $$`
[\code]

i guess that should do

hi
but i want to read it from the process-id file.
i have a lot of scripts which i need to read from a file the variable.
that is specific case which the file conatins the process-id
but my question is for global cases.
can you please tell me how to read it from a file?
thanks

okay
use backtick with the cat command too!
should work

d=`cat process-id`

hi
i will explain again what i want
echo $$ > process-id
now process id conatin 20899
i want that d will contain 20899
if you're using the
d='cat process-id'
and doing
echo $d
d equals cat process-id instead and that is not what i need.
i need that d will be equal to 20899
can someone know how shall i do it ?
note ; i'm working on the linux red hat system.

dude...i don't think you picked my what i wrote previously
i asked to use back-tick (`)

you are using single quotes...
there is a difference

yes
you're write my mistake
it works fine.
thank you very much !