What does this BASH shell script snippet do?
1 answer
As per the Substring Replacement subtitle from the ABS manual :
HOST=${HOST//$'\n'/}
removes all occurrences of the newline character $'\n'
in the variable HOST
.
If the above line was declared inside a function, would the variable be
HOST
available to other functions in the same script?
Yes, assuming it was HOST
not declared using bash local
.
+9
source to share