[Help-bash] Is there a way to contract y=${x[*]}; "${y// /}" into one li
From:
Peng Yu
Subject:
[Help-bash] Is there a way to contract y=${x[*]}; "${y// /}" into one line
Date:
Fri, 27 May 2016 15:58:07 -0500
Hi, I use the following code to remove spaces from the string of
"${x[*]}". But it requires two lines. Is there a way to do it in one
line? Thanks.
x=(a b c)
y=${x[*]}
echo "${y// /}"
--
Regards,
Peng