11. Given the function
$$
f(x)=\left\{\begin{array}{ll}
2^{x}-1, & x \leqslant 0 ; \\
f(x-1)+1, & x>0 .
\end{array}\right.
$$

Let the sum of all real roots of the equation $f(x)=x$ in the interval $(0, n]$ be $S_{n}$. Then the sum of the first $n$ terms of the sequence $\left\{\frac{1}{S_{n}}\right\}$ is $T_{n}=$ $\qquad$
11. $\frac{2 n}{n+1}$.

When $x \in(-1,0]$, we have
$$
(f(x)-x)^{\prime}=2^{x} \ln 2-10$$. Noting that $f(x)=f(x-1)+1$, then on $(k-1, k]$ $f(x)=x$ has only one real root $x=k$. Therefore, $f(x)=x$ has all the real roots $1,2, \cdots, n$ in the interval $(0, n]$, and
$$
\begin{array}{l}
S_{n}=\frac{n(n+1)}{2} \Rightarrow \frac{1}{S_{n}}=2\left(\frac{1}{n}-\frac{1}{n+1}\right) \\
\Rightarrow T_{n}=2\left(1-\frac{1}{n+1}\right)=\frac{2 n}{n+1} .
\end{array}
$$