delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/09/07/14:28:21

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:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type; q=dns; s=default; b=YPqv
x9/BklsbTXK3OFguQfdEHGvSvDwRj73p1HshGuZ7aoraqJRIjHxmvBk+SHjJScjn
bbi+qKglAlu9Q2Iz/y13YXLdg8KhBXuSSr9NoteAloaDwvUTsONTz6iuAQ8iHqQu
bQa1RuxevUEATKxJVC/vewYEQ9Z5Ynxy58UdIsU=
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:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type; s=default; bh=Wf1g6dEsyh
HQNvxGRrZ8sOjozjQ=; b=kjX0Nqsb7Vlk/rxBNkw4f1C61/GZaPxUzXl8daOZ3P
UVgj6QNCBLR/qAF+mVCQA4SZQCuOYPhgoSGw/XFIGFvzd68VrkGeGfdxeaITrLdd
TRr/Vz5z5jx3IOoN0fn63gWFaROBF85e1tD1V30fHyvCBU8PEMVBacksfGYCd368
0=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=707b, 7463, 243d, 6f72
X-HELO: mx1.redhat.com
Subject: Re: Bash shell script issue
To: cygwin AT cygwin DOT com
References: <330568691 DOT 2384551 DOT 1473201409220 DOT ref AT mail DOT yahoo DOT com> <330568691 DOT 2384551 DOT 1473201409220 AT mail DOT yahoo DOT com> <c0b897be-d3cf-f3b9-cf5b-0024a1d395e5 AT redhat DOT com> <1709131555 DOT 354781 DOT 1473264514358 AT mail DOT yahoo DOT com> <15510127987 DOT 20160907202742 AT yandex DOT ru>
From: Eric Blake <eblake AT redhat DOT com>
Openpgp: url=http://people.redhat.com/eblake/eblake.gpg
Message-ID: <eb1c8bc2-6f49-47ae-73ee-7acefd7fefc8@redhat.com>
Date: Wed, 7 Sep 2016 13:27:51 -0500
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0
MIME-Version: 1.0
In-Reply-To: <15510127987.20160907202742@yandex.ru>
X-IsSubscribed: yes

--A6UkIsGFQMBFagxbUKdcq9NXTb17ABMm2
Content-Type: multipart/mixed; boundary="uKbEj6pbH6kOe3Ci9QBdqGxUtnkccrv46"
From: Eric Blake <eblake AT redhat DOT com>
To: cygwin AT cygwin DOT com
Message-ID: <eb1c8bc2-6f49-47ae-73ee-7acefd7fefc8 AT redhat DOT com>
Subject: Re: Bash shell script issue
References: <330568691 DOT 2384551 DOT 1473201409220 DOT ref AT mail DOT yahoo DOT com>
 <330568691 DOT 2384551 DOT 1473201409220 AT mail DOT yahoo DOT com>
 <c0b897be-d3cf-f3b9-cf5b-0024a1d395e5 AT redhat DOT com>
 <1709131555 DOT 354781 DOT 1473264514358 AT mail DOT yahoo DOT com>
 <15510127987 DOT 20160907202742 AT yandex DOT ru>
In-Reply-To: <15510127987 DOT 20160907202742 AT yandex DOT ru>


--uKbEj6pbH6kOe3Ci9QBdqGxUtnkccrv46
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 09/07/2016 12:27 PM, Andrey Repin wrote:
>> 243d    707b    6f72    656a    7463    725f    6f6f    7d74=20
>> 0000120   /   t   o   o   l   s  \r  \n   e   c   h   o       $   x  \r=
=20

                                   ^^^                                ^^

>=20
>> Shows there is not "careless editing".=20

Umm, those \r ARE carriage returns, as the result of the careless
editing that converted your file to CRLF endings.  Use d2u to strip them
back out.

>> project_root=3D$PWD
>=20
> Still bad.

No, that one's good.  Quotes are only REQUIRED when you want to ensure
that there is no word splitting or globbing going on, and assignment
context has neither of those.  However, although the quotes are optional
in that context, using them out of habit makes it easier to remember to
use quotes in the contexts where it does matter.

>=20
>> echo "$project_root"
>=20
> Good.
>=20
>> x=3D${project_root}/tools=20
>=20
> Still bad.

No, that one's okay.  In fact, if you are going for minimalism, you
could use:

x=3D$project_root/tools

as the ${} form is only REQUIRED when you are using operators inside {}
or when the next character after } is ambiguous with a continuation of
the name of the variable in after the $.

--=20
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


--uKbEj6pbH6kOe3Ci9QBdqGxUtnkccrv46--

--A6UkIsGFQMBFagxbUKdcq9NXTb17ABMm2
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBCAAGBQJX0FwnAAoJEKeha0olJ0NqtdgH/RY8/SU7hygv44mmVFltyWW6
Vz5AQl/PQZ82xueNYRBsPnXKZSzrCjAWEtsHby5rHnexEJ8i1p9oVaI/2y3/JXOF
VTcF0NmFoM0UOf00DHSfb2FVaG7YLfhBZHggGMwD+vY8vLhENbTZoS7MJBPgWQvV
c8586a99SHFzowjHgN5OKUXwUlprO93EDEcWgR+04Vfkjfqe6WZJIvjn/VtAU8R8
m3j0gTSfMbFmzr5idAbmgIn8A9ASWJ2N0Gqf2ZyDJN6ptCegnoDoS/1Wt1XzYMmf
CppE9JkxAFchl1QkAUNrEDrjSrgfcg0hiloT5Jrq0RqDbd9rG7Vum8yY0khGKBo=
=p5b5
-----END PGP SIGNATURE-----

--A6UkIsGFQMBFagxbUKdcq9NXTb17ABMm2--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019