simple problems in awk

Dear All,

I have the following awk script.

    #!/bin/bash
       sh stdev.cmd  data.file  | awk '{print $2}' > out.data
       read d < out.data
       echo $d
       awk '{print $1,$2- $f}'  new > newz

The script runs "stdev.cmd" and output a file "out.data" and the value of the "out.data" read and assigned to a variable d. Echo $d does produce the right values (example d=10).
What I want is to subtract the value of variable "d" to every second field of the file "new" ($2). But it does not work ?

Any help appreciated

Regards
Yacob

awk -v d="$d" '{ print $1, $2 - d }' new > newz

if d=10,

awk -v dval=$d '{print $1,$2-dval}' new > newz

BTW, you have written $f in awk, which is neither a shell nor an awk variable !! (at least in this context).