From owner-freebsd-questions@FreeBSD.ORG Fri Sep 5 20:10:56 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6A30516A4BF for ; Fri, 5 Sep 2003 20:10:56 -0700 (PDT) Received: from rwcrmhc13.comcast.net (rwcrmhc13.comcast.net [204.127.198.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id 47EE443FEC for ; Fri, 5 Sep 2003 20:10:55 -0700 (PDT) (envelope-from freebsd-questions-local@be-well.no-ip.com) Received: from be-well.ilk.org (be-well.no-ip.com[66.30.200.37]) by comcast.net (rwcrmhc13) with ESMTP id <2003090603105301500p7449e>; Sat, 6 Sep 2003 03:10:53 +0000 Received: from be-well.ilk.org (lowellg.ne.client2.attbi.com [66.30.200.37] (may be forged)) by be-well.ilk.org (8.12.9/8.12.9) with ESMTP id h863AmYB083517; Fri, 5 Sep 2003 23:10:48 -0400 (EDT) (envelope-from freebsd-questions-local@be-well.no-ip.com) Received: (from lowell@localhost) by be-well.ilk.org (8.12.9/8.12.6/Submit) id h863AlZa083514; Fri, 5 Sep 2003 23:10:47 -0400 (EDT) X-Authentication-Warning: be-well.ilk.org: lowell set sender to freebsd-questions-local@be-well.ilk.org using -f Sender: lowell@be-well.no-ip.com To: "Charles Howse" References: <000901c373fa$43007eb0$04fea8c0@moe> From: Lowell Gilbert Date: 05 Sep 2003 23:10:47 -0400 In-Reply-To: <000901c373fa$43007eb0$04fea8c0@moe> Message-ID: <44ad9i4nns.fsf@be-well.ilk.org> Lines: 16 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii cc: freebsd-questions@freebsd.org Subject: Re: FBSD equivalent to Linux cp -u X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: freebsd-questions@freebsd.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2003 03:10:56 -0000 "Charles Howse" writes: > I have read man cp, and I don't see a way to copy source file to > destination file *only* if source file is newer than destination file. > > In Linux, I could do cp -u. Is there another utility that can pull this > off? In sh(1), it should be as simple as: if [ $sourcefile -nt $destinationfile ] ; then cp -p $sourcefile $destinationfile ; fi [untested]