How do I insert a nice tilde that is centered in the middle in a lstlisting? I found another thread about tildes but I can't apply it because the method described there only works outside of lstlisting as lstlisting displays all the text literally. Any ideas?
Here is how the tilde looks in my document at the moment - it's at the very top of the font and I would like it to be in the middle (like ~ this).

Here is the LaTeX for this fragment:
\section{Remove duplicate, consecutive lines (emulate "uniq")}
\begin{lstlisting}
awk 'a !~ $0; { a = $0 }'
\end{lstlisting}
Variables in Awk don't need to be initialized or declared before they are being used.

