Quote:
Originally Posted by jonaskellens
Number=${Number/ /} removes white spaces
|
It removes spaces. Your previous version,
${Number//[[:space:]]}, removes whitespace. Whitespace is any of the characters space, tab and newline.
EDIT: actually
${Number/ /} removes only the first space.
${Number// /} removes all spaces and can be more simply given as
${Number// }. Here's a command prompt illustration:
Code:
c@CW8:~$ x=' a b c '
c@CW8:~$ echo "'${x/ /}'"
'a b c '
c@CW8:~$ echo "'${x// /}'"
'abc'
c@CW8:~$ echo "'${x// }'"
'abc'