Echo and backslash (bash) -


i'm trying make function in ~/.bashrc file uses echo command pass arguments through pipeline. works, when try input '\' character disappears. if type \\ (two '\') succeeds. heppens -e option...

so, how can make code below prints "foo\bar" instead of "foobar"?

func() {     echo -e "${@}" } 

it not echo interpretes backslash, shell. gets interpreted before function gets called. correct solution quote argument function.

func() {     echo -e "${@}" }  func 'foo\bar' 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Socket.connect doesn't throw exception in Android -

iphone - How do I keep MDScrollView from truncating my row headers and making my cells look bad? -