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 host available other functions in same script?

yes, assuming host wasn't declared using bash local keyword.


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

asp.net core mvc - How important is the global.json and src folder? -

Maven Javadoc 'Cannot find default setter' and fails -