Como remover todos os espaço em uma corda em Bash

#!/bin/bash

#Make our variable
var="foo bar"

#Print it without the spaces
echo ${var//[[:blank:]]/}

#Output will be foobar
HuffleGamer123