regex - What does this BASH shell script excerpt do? -
can explain following code please (assume host contains string):
host=${host//$'\n'/} if above line declared inside function, variable "host" available other functions in same script?
according substring replacement subchapter abs guide:
host=${host//$'\n'/} removes all occurrences of newline character $'\n' in host variable.
if above line declared inside function, variable
hostavailable other functions in same script?
yes, assuming host wasn't declared using bash local keyword.
Comments
Post a Comment