X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:reply-to:subject:to:references:from:message-id :date:mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=Ht/IR9Zf7we3A01w QwhOLy7XsKVKtjpMh9yhlVBzApxdn2bwgICPjlPcXRK2UNVbLOl0DU/vYu8lhxal LI7NHz0KslHfz/RQ2UyVxBeF0jMifH3AnSFjugs/6QbvDjnt1Lz8yW+mCzePOf1P nlLOfyxOV6iteTAFvDGWa9yg/ds= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:reply-to:subject:to:references:from:message-id :date:mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=sT4KfYIsNQZDfRFcpHk0sa yic4Q=; b=ict0j5j4o+d8zVfgrw8AR/RpImDrkqVs0HzbIyrHrd2TkrLMDwB5fL RbTZRPCc0QQ/NBvZYmA26yqkA/JJWgENab850gPMwFNG1pm5uV7sgbSg0E5kPFwK ZUzG+wd+pdzMAu7WHNFMlIxPb3Cdin6girHOlV+FnLhfECzFgBTnQ= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=canada, Canada, disturbing, H*F:D*ca X-HELO: smtp-out-so.shaw.ca Reply-To: Brian DOT Inglis AT SystematicSw DOT ab DOT ca Subject: Re: gnanny: tr: warning: an unescaped backslash at end of string is not portable To: cygwin AT cygwin DOT com References: <5C29F63E DOT 9010606 AT tlinx DOT org> From: Brian Inglis Openpgp: preference=signencrypt Message-ID: <2716611a-829f-7588-7533-b03ff9d2060b@SystematicSw.ab.ca> Date: Mon, 31 Dec 2018 07:47:23 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes 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 '\' '/' > 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