更新时间:2023-12-04 10:51:58
$ {REV %% $'\ n *'}
似乎有效.参见 bash文档的引用部分.>
does not work
echo ${REV%%\n*}
does work
echo ${REV%%
*}
After reading trough http://tldp.org/LDP/abs/html/parameter-substitution.html I still can not figure out how to make \n work.
${REV%%$'\n*'}
seems to work. See the quoting section of the bash documentation.