Path: csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: Greg Wooledge Newsgroups: gnu.bash.bug Subject: Re: problem with extra space; setting? cygwin only? Date: Tue, 23 Jun 2020 15:42:37 -0400 Lines: 31 Approved: bug-bash@gnu.org Message-ID: References: <20200623192919.GJ19673@eeg.ccf.org> <20200623194237.GK19673@eeg.ccf.org> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: usenet.stanford.edu 1592941368 14243 209.51.188.17 (23 Jun 2020 19:42:48 GMT) X-Complaints-To: action@cs.stanford.edu To: bug-bash@gnu.org Envelope-to: bug-bash@gnu.org Mail-Followup-To: bug-bash@gnu.org Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Received-SPF: none client-ip=139.137.100.1; envelope-from=wooledg@eeg.ccf.org; helo=mail.eeg.ccf.org X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/23 15:29:19 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) BAYES_00=-1.9, KHOP_HELO_FCRDNS=1, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <20200623194237.GK19673@eeg.ccf.org> X-Mailman-Original-References: <20200623192919.GJ19673@eeg.ccf.org> Xref: csiph.com gnu.bash.bug:16449 On Tue, Jun 23, 2020 at 12:33:23PM -0700, L A Walsh wrote: > It's a gmail feature to mangle your input in weird ways when you cut/paste. > the line with 'output=""' is separate from the "printf" line. Sorry. First, stop top-quoting. Second, if you know that gmail is horrible and is going to mangle your input, stop using it. Third, if you actually want to debug the issue, you will get a MUCH better view of the variable's contents if you hex-dump it, instead of just throwing some random punctuation around it and praying that what you see on the terminal is all that's in the variable. printf %s "$output" | od -tx1 -An or something similar. Since you mentioned Cygwin, and since you mentioned gmail, one can guess that Microsoft Windows is invovled in this picture, which means that carriage returns are likely to be involved in this picture, which can mess up a script in a multitude of ways. Hex-dumping the variable's contents would be a reasonably sure way to tell whether there are carriage returns, non-breaking spaces, or other abominations in the variable. If it turns out that the variable actually *is* clean, and you've legitimately found some sort of bug that only happens in the Cygwin environment, well, congratulations. I guess. Not that many people on this list have access to that environment for confirmation purposes.