Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

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
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #remove #space #string #bash
ADD COMMENT
Topic
Name
7+6 =