Answers for "how to remove every space in a string in bash"

0

how to remove every space in a string in bash

#!/bin/bash

#Make our variable
var="foo bar"

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

#Output will be foobar
Posted by: Guest on October-17-2020

Code answers related to "how to remove every space in a string in bash"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language