I'm little bit confused about this statement(construction?). I cound't find any sufficient source about this (I do not even know how to call it).What is happening here?bash-4.3$ var=a/bbash-4.3$ f=${var/b/c/\d}                                                                                                                                                                                                             bash-4.3$ echo $f                                                                                                                                                                                                                     a/c/dor this:bash-4.3$ var=b/a                                                                                                                                                                                                                   bash-4.3$ f=${var/b/c/\d}                                                                                                                                                                                                             bash-4.3$ echo $f                                                                                                                                                                                                                     c/d/a Thanks
What ${var/a/b/\c} means?
bash;string
Read about bash's parameter expansion.In your examples you're using the search and replace syntax which substitutes the first occurrence of the given pattern.${parameter/pattern/string}Example:> X=aaaa> echo ${X/a/b}   # substitute first occurence of a with b> baaaThe syntax to replace all occurrences is:${parameter//pattern/string}Example:> X=aaaa> echo ${X//a/b}   # substitute all occurences of a with b> bbbbThus in your first example your parameter was a/b and you told bash to replace the first occurence of b in a/b (the value of var) with the string c/d (which results in a/c/d). Note that \d is unnecessarily escaped - no difference to d alone).