From owner-freebsd-hackers@FreeBSD.ORG Thu Jul 27 21:39:57 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2FCD016A4DA; Thu, 27 Jul 2006 21:39:57 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id A59AB43D6D; Thu, 27 Jul 2006 21:39:53 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.4/8.13.4) with ESMTP id k6RLdqXu080692; Thu, 27 Jul 2006 17:39:52 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Thu, 27 Jul 2006 17:30:14 -0400 User-Agent: KMail/1.9.1 References: <200607271150.k6RBoM9p031745@lurza.secnetix.de> <44C8FB65.9020102@FreeBSD.org> In-Reply-To: <44C8FB65.9020102@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200607271730.14998.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Thu, 27 Jul 2006 17:39:52 -0400 (EDT) X-Virus-Scanned: ClamAV 0.87.1/1624/Thu Jul 27 13:11:25 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx Cc: Doug Barton Subject: Re: [PATCH] adding two new options to 'cp' X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jul 2006 21:39:57 -0000 On Thursday 27 July 2006 13:44, Doug Barton wrote: > Oliver Fromme wrote: > > Eric Anderson wrote: > > > I'm tired of trying to use rsync or gcp (which doesn't like symlinks > > > often) to copy trees of files/directories using hard links, so I added > > > the gcp-ish options -a and -l. > > > > > > -a is 'archive' mode, which is just a quick form of -PpR. > > > > -P is the default anyway, so -a would only replace -Rp. > > I don't think saving one letter justifies introducing a new > > option. You can use an alias or shell function. > > > > > -l is 'link' mode, where regular files get hard linked instead of copied. > > > > > > So, you can mimic an entire tree with something like: > > > > > > cp -al /from/ /to/ > > > > > > and it's fast too! > > > > You can do the same with existing tools in a portable > > (and thus preferable) way: > > > > cd /from; find -d . | cpio -dumpl /to > > While I don't want to stifle anyone's creativity, I agree with Oliver (and > other posters) on this one. The Unix way of doing things is small programs > that do their jobs well, tied together to accomplish bigger things. OTOH, 'cp -al' is a lot less to type. :) It also is not NIH as it is simulating the interface of another system. Maybe I'm just stodgy b/c I never use cpio(8) (it seems to be one of the more cryptic programs). -- John Baldwin