Another alternative is to use the printf function.
printf -v str 'hello'
In addition, this design, combined with the use of single quotes, where appropriate, helps to avoid problems with multiple shoots of subshells and other forms of interpolation citation.
jxqz Apr 04 '14 at 23:16 2014-04-04 23:16
source share