You can use catchfile:
\documentclass{article}
\usepackage{catchfile}
\begin{document}
\CatchFileDef\repository{|"kpsewhich eng_rs.sty | xargs basename"}{\catcode`_=12 }
\texttt{\repository}
\texttt{\meaning\repository}
\end{document}
I used a file name having an underscore, just by way of example.

A possibly better version, with xparse:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{xparse}
\ExplSyntaxOn
\NewDocumentCommand{\getfilename}{O{}mo}
{
% #1 = optional list of characters to be made printable
% #2 = variable part
% #3 = optional command to save the returned token list in
\tl_set_from_file:Nnn \l_maciek_filename_tl
{
\maciek_filename_setother:n { #1 }
}
{
|"#2"
}
\IfValueTF{#3}
{
\tl_clear_new:N #3
\tl_set_eq:NN #3 \l_maciek_filename_tl
}
{
\tl_use:N \l_maciek_filename_tl
}
}
\cs_new_protected:Nn \maciek_filename_setother:n
{
\tl_map_function:nN { #1 } \char_set_catcode_other:N
}
\ExplSyntaxOff
\begin{document}
\getfilename[_]{kpsewhich eng_rs.sty | xargs basename}
\getfilename[_]{kpsewhich eng_rs.sty | xargs dirname}[\foo]
\meaning\foo
\getfilename[\%]{ls | grep b}
\getfilename[\%_]{ls | grep y}
\end{document}
I have created two files a%b.tex and a_x%y.tex just to show the usage of the first optional argument. A backslash is needed for characters such as backslash, percent and hash mark (#).

\detokenizebut that would make all characters inactive but if you have any non-ascii utf8 filenames they then will show as the individual bytes, so it is probably better just to make the ascii characters safe by setting their catcodes, you could use (or copy bits of)\verb– David Carlisle Jul 11 '17 at 10:09