public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* gnanny: tr: warning: an unescaped backslash at end of string is not portable
@ 2018-12-31 12:32 L A Walsh
  2018-12-31 14:47 ` Eliot Moss
  0 siblings, 1 reply; 3+ messages in thread
From: L A Walsh @ 2018-12-31 12:32 UTC (permalink / raw)
  To: cygwin

This is being run on cygwin w/bash, version 4.4.12(3)-release.


Have a table of windows files, sample line (it's all 1 line):
>  cat test
D,"c:\windows\system32\FMS.DLL",2010-11-20 19:24:33,2010-11-20 
03:59:27,93696,A,0x00024E23,0x00024E23,x86,GUI,"CV",0x04480000,Unknown,0x00019000,Not 
Loaded,1.1.6000.16384,1.1.6000.16384,6.1,9.0,6.1,6.1

I run 'tr' to switch around the backslashes to slashes:

>  tr '\' '/' <test
tr: warning: an unescaped backslash at end of string is not portable
D,"c:/windows/system32/FMS.DLL",2010-11-20 19:24:33,2010-11-20 
03:59:27,93696,A,0x00024E23,0x00024E23,x86,GUI,"CV",0x04480000,Unknown,0x00019000,Not 
Loaded,1.1.6000.16384,1.1.6000.16384,6.1,9.0,6.1,6.1


1) First question: what unescaped backslash?  The '\n is escaped via the 
surrounding quotes.

2) how should one escape it?

Is this a bug?



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: gnanny: tr: warning: an unescaped backslash at end of string is not portable
  2018-12-31 12:32 gnanny: tr: warning: an unescaped backslash at end of string is not portable L A Walsh
@ 2018-12-31 14:47 ` Eliot Moss
  2018-12-31 15:01   ` Brian Inglis
  0 siblings, 1 reply; 3+ messages in thread
From: Eliot Moss @ 2018-12-31 14:47 UTC (permalink / raw)
  To: cygwin

On 12/31/2018 5:58 AM, L A Walsh wrote:
> This is being run on cygwin w/bash, version 4.4.12(3)-release.
> 
> 
> Have a table of windows files, sample line (it's all 1 line):
>>  cat test
> D,"c:\windows\system32\FMS.DLL",2010-11-20 19:24:33,2010-11-20 
> 03:59:27,93696,A,0x00024E23,0x00024E23,x86,GUI,"CV",0x04480000,Unknown,0x00019000,Not 
> Loaded,1.1.6000.16384,1.1.6000.16384,6.1,9.0,6.1,6.1
> 
> I run 'tr' to switch around the backslashes to slashes:
> 
>>  tr '\' '/' <test
> tr: warning: an unescaped backslash at end of string is not portable
> D,"c:/windows/system32/FMS.DLL",2010-11-20 19:24:33,2010-11-20 
> 03:59:27,93696,A,0x00024E23,0x00024E23,x86,GUI,"CV",0x04480000,Unknown,0x00019000,Not 
> Loaded,1.1.6000.16384,1.1.6000.16384,6.1,9.0,6.1,6.1
> 
> 
> 1) First question: what unescaped backslash?  The '\n is escaped via the surrounding quotes.
> 
> 2) how should one escape it?
> 
> Is this a bug?

It is referring to your input '\' and would prefer '\\'.

Best - Eliot Moss

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: gnanny: tr: warning: an unescaped backslash at end of string is not portable
  2018-12-31 14:47 ` Eliot Moss
@ 2018-12-31 15:01   ` Brian Inglis
  0 siblings, 0 replies; 3+ messages in thread
From: Brian Inglis @ 2018-12-31 15:01 UTC (permalink / raw)
  To: cygwin

On 2018-12-31 05:57, Eliot Moss wrote:
> On 12/31/2018 5:58 AM, L A Walsh wrote:
>> This is being run on cygwin w/bash, version 4.4.12(3)-release.
>> Have a table of windows files, sample line (it's all 1 line):
>>>  cat test
>> D,"c:\windows\system32\FMS.DLL",2010-11-20 19:24:33,2010-11-20
>> 03:59:27,93696,A,0x00024E23,0x00024E23,x86,GUI,"CV",0x04480000,Unknown,0x00019000,Not
>> Loaded,1.1.6000.16384,1.1.6000.16384,6.1,9.0,6.1,6.1
>> I run 'tr' to switch around the backslashes to slashes:
>>>  tr '\' '/' <test
>> tr: warning: an unescaped backslash at end of string is not portable
>> D,"c:/windows/system32/FMS.DLL",2010-11-20 19:24:33,2010-11-20
>> 03:59:27,93696,A,0x00024E23,0x00024E23,x86,GUI,"CV",0x04480000,Unknown,0x00019000,Not
>> Loaded,1.1.6000.16384,1.1.6000.16384,6.1,9.0,6.1,6.1
>> 1) First question: what unescaped backslash?  The '\n is escaped via the
>> surrounding quotes.
>> 2) how should one escape it?
>> Is this a bug?
> It is referring to your input '\' and would prefer '\\'.

The problem is in your command line argument single backslash
info/man tr
tr accepted common character escapes, and now also classes and equivalences in
sets to support utf8 and other extended charsets e.g.

	$ tr '\' /
	tr: warning: an unescaped backslash at end of string is not portable
	^D

use	$ tr '\\' /

	$ tr \\ /
	tr: warning: an unescaped backslash at end of string is not portable
	^D

use	$tr \\\\ /

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-12-31 14:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-31 12:32 gnanny: tr: warning: an unescaped backslash at end of string is not portable L A Walsh
2018-12-31 14:47 ` Eliot Moss
2018-12-31 15:01   ` Brian Inglis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).