Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

remove white space from stering in bash

$ var='abc def'
$ echo "$var"
abc def
# Note: flussence's original expression was "${var/ /}", which only replaced the *first* space char., wherever it appeared.
$ echo -n "${var//[[:space:]]/}"
abcdef
Source by linuxhint.com #
 
PREVIOUS NEXT
Tagged: #remove #white #space #stering #bash
ADD COMMENT
Topic
Name
2+6 =