I'm writing a document for general purpose so that anyone can follow it and the idea is to copy and paste this command in a Linux terminal. But when I do that in a terminal give me error because quotation marks are displayed like this ” instead of " and hyphens are rendered as an en-dash − (a large dash) instead of this -.
What I achieved:
\lstdefinestyle{BashInputStyle}{
language=bash,
basicstyle=\small\sffamily,
numbers=left,
numberstyle=\tiny,
numbersep=3pt,
frame=tb,
columns=fullflexible,
backgroundcolor=\color{yellow!20},
linewidth=0.9\linewidth,
xleftmargin=0.1\linewidth
}
For example this:
\begin{lstlisting}[style=BashInputStyle]
$ sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
\end{lstlisting}
produces this PDF output:
and the text copied from the PDF is:
sh −c ”$(curl −fsSL https://raw.github.com/robbyrussell/oh−my−zsh/master/tools/install.sh)”
but it should be like this:
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"


~to the answer ;) – Phelype Oleinik Feb 07 '19 at 13:43