delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/10/20/15:35:21

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-10.6 required=5.0 tests=AWL,BAYES_00,KHOP_PGP_SIGNED,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS
X-Spam-Check-By: sourceware.org
Message-ID: <5082FCE5.8040703@redhat.com>
Date: Sat, 20 Oct 2012 13:35:01 -0600
From: Eric Blake <eblake AT redhat DOT com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121009 Thunderbird/16.0
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Cp can't hardlink unqualified wildcard
References: <20121020185055 DOT 248730 AT gmx DOT com>
In-Reply-To: <20121020185055.248730@gmx.com>
OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg
X-IsSubscribed: yes
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

--------------enig85357908D5BB155DAE94B9E1
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On 10/20/2012 12:50 PM, Lawrence Mayer wrote:
> Cp can't hardlink unqualified wildcard
>=20
> cp -l * DIRECTORY
>=20
> fails with error 'cp: target `file' is not a directory'

Most likely, this is not an error in cp, but a misunderstanding on your
part about how globbing operates.  I bet you have a file in your current
directory whose name starts with '-', and is thus being treated as an
option by cp.

>=20
> But the equivalent
>=20
> cp -l ./* DIRECTORY

No, that's not quite equivalent - it guarantees that the glob won't be
mis-handled as an option.  Likewise,

cp -l -- * DIRECTORY

will avoid treating the glob as an option.  Not only that, but this is a
FAQ:
https://www.gnu.org/software/coreutils/faq/#I-have-a-file-_0027_002df_0027-=
and-it-affects-rm_002e

>=20
> AND
>=20
> cp -l PATH OF WORKING DIRECTORY/* DIRECTORY

Sorry, but that's not what you typed.  It helps to show actual examples
when claiming you have a bug.


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


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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQEcBAEBCAAGBQJQgvzlAAoJEKeha0olJ0NqTAMH/1Xxi46TWrIfPsoKC1Svmcf/
HWalVw7u9aS4AQJuzTvZEbSDPHI2GfB+ZaobjizEsoa1pvag/U3CSKpnEAVkz1uZ
6dXM0lr4fsiCmAtkz6ecpkBWv+sJ1KCh00RzXhUevxBOcVRXZoO6RgO9eoW5dcRT
zKeLOA48Yh/lkfODJw0zMKs1oymFvcIIGfiiLGtDKuoowWcLaCw5Zs3Xux9avG30
SmWSaq4J1wToc5tCrsivcAn0pou8iwAER/+w/TyfYHnusIFS7Rekw5HYQ5gM5+cB
B5sFZ0BupK3F6+h4mTX8hrb0l81DiDS4EButV04/QqX7KgPgs8xWbhsTOfNxBw4=
=yM2e
-----END PGP SIGNATURE-----

--------------enig85357908D5BB155DAE94B9E1--

- Raw text -


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