There are multiple way to remove spaces,
# Variable a contains the following
a="Hello World !"
echo
echo ${a// /}
Sed
echo $a | sed "s/\ //g"
tr
tr -d ' ' <<<"$a"
or
echo $a | tr -d ' '
Returned output
HelloWorld!
There are multiple way to remove spaces,
# Variable a contains the following
a="Hello World !"
echo
echo ${a// /}
Sed
echo $a | sed "s/\ //g"
tr
tr -d ' ' <<<"$a"
or
echo $a | tr -d ' '
Returned output
HelloWorld!