Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Oct 2016 14:50:02 +0000
From:      Manish Jain <bourne.identity@hotmail.com>
To:        freebsd-questions <freebsd-questions@freebsd.org>
Subject:   A request for cp flag
Message-ID:  <VI1PR02MB0974F08FABD625DE9C2472B8F6D00@VI1PR02MB0974.eurprd02.prod.outlook.com>

next in thread | raw e-mail | index | archive | help


Hi,

I am using FreeBSD 10.3 amd64 with bash as the login shell.

I occasionally face a problem while copying contents with cp. The -R 
flag of cp takes the source name as this : If the source_file ends in a 
/, the contents of the directory are copied rather than the directory 
itself.

Now, I am pretty sure, there must be good reasons for cp to behave in 
that manner by default. But it also creates significant opportunities 
for things to go wrong the way shell completion of directory names works.

Could it considered a valid request that an extra flag (perhaps -r) be 
implemented that does the reverse : copy out src rather than src/* ?

Thanks
Manish Jain


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?VI1PR02MB0974F08FABD625DE9C2472B8F6D00>