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 -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -