bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Space removal in AE takes place before brace expansion


From: Greg Wooledge
Subject: Re: Space removal in AE takes place before brace expansion
Date: Mon, 1 May 2017 09:43:23 -0400
User-agent: Mutt/1.4.2.3i

On Mon, May 01, 2017 at 03:29:43PM +0200, Florian Mayer wrote:
> > sum=0; for ((i=1; i<=10; i++)); do ((sum+=i)); done
> You can actually omit ???sum=0;???, because bash dereferences unset variables 
> to 0
> (according to the holy manual of course).

Not if the user running the script exported sum=bwahahaha into the
environment.  That's why you should always initialize shell variables
before reading them (unless the ability to pass one in through the
environment is an intended feature of your script, in which case you
want to sanity check it).

> > I cannot figure out what you actually typed here, because your UTF-8
> 
> I don???t know what caused that, but it was not intentionally.
> https://lists.gnu.org/archive/html/bug-bash/2017-04/msg00152.html
> correctly shows what I???ve submitted.

Going there in a GUI browser on a Debian (UTF-8) system and then
copy/pasting one of your quote-marks into a printf|hd command confirms
that you are using UTF-8 curly quotes.

wooledg:~$ printf %s "?" | hd
00000000  e2 80 99                                          |...|
00000003

However, my mail client is on an HP-UX (Latin-1) system, so I cannot
paste the actual symbol here.  I'll use a single question mark instead.

If your commands "work" in your shell, but then magically transform into
unusable curly quote glyphs in your mail client, then it's probably your
mail client performing the transformation.  Or your text editor, or your
web browser if you're using web-mail.

Your apostrophes in the words "don't" and "I've" up above are also
mangled, as are whatever you put around "sum=0;" in your first sentence.
Just so you know.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]