Re: Unexpected behaviour: double backslash in single quotes

2018-09-06 Thread Joshua Phillips
On Thu, Sep 6, 2018, at 12:48, Eric Blake wrote: > On 09/06/2018 04:40 AM, Joshua Phillips wrote: > > Escape sequences don't work in single quotes: > > > > $ echo 'hello\world' > > hello\world > > $ echo 'hello\' > > Warning. Use of 'echo' and backslashes is non-portable. There are two >

Re: Unexpected behaviour: double backslash in single quotes

2018-09-06 Thread Eric Blake
On 09/06/2018 04:40 AM, Joshua Phillips wrote: Escape sequences don't work in single quotes: $ echo 'hello\world' hello\world $ echo 'hello\' Warning. Use of 'echo' and backslashes is non-portable. There are two classical behaviors: 1. backslashes are not special to echo unless you pass -e,

Re: Unexpected behaviour: double backslash in single quotes

2018-09-06 Thread Joshua Phillips
On Thu, Sep 6, 2018, at 09:40, Joshua Phillips wrote: > Escape sequences don't work in single quotes: > > $ echo 'hello\world' > hello\world > $ echo 'hello\' > hello\ > > Which makes it surprising that double backslashes get converted to > single backslashes: > > $ echo 'hello\\world' >