Uniformly convergent on each compact set of $\mathbb R$ but not on $\mathbb R$ As the title says, I am looking for a sequence of function which is uniformly convergent on all compact sets of $\mathbb R$ but not on $\mathbb R$. 
I thought $f_n(x) = \frac{x}{n}$ is such a function since for any x in a bounded and closed subset of $\mathbb R$. $\sup(f_n(x)-f(x)) \to 0$ as $n\to\infty$. But since $\mathbb R$ is unbounded $x$ can get infinitely large thus the function sequence does not uniformly converge on $\mathbb{R}$. I wanted to check if my understanding is correct. Thank you

As explained above in the post, the answer is {$f_n(x) = \frac{x}{n}; n \geq 1$ and $x \in \mathbb R $}
