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
Post a Comment