OrgMode, Is it possible to group options and pass them to LaTeX listings?

I have got an Org buffer like

#+LaTeX_CLASS_OPTIONS: [a4paper]
* How to group ATTR_LATEX options?
#+ATTR_LATEX: :options language=bash,basicstyle=\small\ttfamily, numbers=left,numberstyle=\tiny,numbersep=3pt,frame=tb
This is a demo of what the listings package produce.
#+BEGIN_SRC sh
echo "hello world"
#+END_SRC


Which I can export to LaTeX. However, I would like to group the options passed to the LaTeX listings by defining a macro for the lstlisting environment. For example, I want Org Mode to generate something like :

\documentclass{article}
\usepackage{xcolor}
\usepackage{listings}
\lstdefinestyle{BashInputStyle}{
language=bash,
basicstyle=\small\ttfamily,
numbers=left,
numberstyle=\tiny,
numbersep=3pt,
frame=tb
}
\begin{document}
\section{How to group ATTR$$_{\text{LATEX}}$$ options?}
This is a demo of what the listings package produce.
\begin{lstlisting}[style=BashInputStyle]
echo "hello world"
\end{lstlisting}
\end{document}


I am able to get the lstdefinesstyle into the LaTex buffer with:

#+LATEX_HEADER: \lstdefinestyle{BashInputStyle}{language=bash,basicstyle=\small\ttfamily, numbers=left,numberstyle=\tiny,numbersep=3pt,frame=tb}


However, I do not know what do to go get that definitions exported to \begin{lstlisting}[style=BashInputStyle]. Any advice ?

The org manual suggests doing it as follows, passing the options via a #+ATTR_LATEX: tag just before the source block.

#+LaTeX_CLASS_OPTIONS: [a4paper]

Note that org writes out a new \lstset before each listing regardless of whether you specify options or not. This means the above settings apply just to the one given listing.