Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
It's called bash parameter substitution
https://www.tldp.org/LDP/abs/html/parameter-substi...
Your example is described as
${var//Pattern/Replacement}
Global replacement. All matches of Pattern, within var replaced with Replacement.
Usage example - strips double quotes from input
bash-3.2$ ./test1.sh 'aaa""bbb'
aaabbb
bash-3.2$ cat test1.sh
#!/bin/bash
testvar=${1//\"/}
echo $testvar
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question