Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Sep 2003 07:00:48 -0500
From:      "Charles Howse" <chowse@charter.net>
To:        <freebsd-questions@freebsd.org>
Cc:        lowell@be-well.no-ip.com
Subject:   RE: FBSD equivalent to Linux cp -u
Message-ID:  <000c01c3746e$832b8d80$04fea8c0@moe>
In-Reply-To: <44ad9i4nns.fsf@be-well.ilk.org>

next in thread | previous in thread | raw e-mail | index | archive | help
> > 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]

Thanks, Lowell.  Once again I've had an attack of the dumb-ass!  :-)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?000c01c3746e$832b8d80$04fea8c0>