On Fri, Nov 26, 2010 at 12:29:27PM +0100, Denys Vlasenko wrote:
> On Fri, Nov 26, 2010 at 11:00 AM, David Collier
> > Can anyone tell me if there is anything around as standard that might
> > allow me to do the equivalent of
> >
> > touch /tmp/fred "+3days"
> 
> plus3days=$(date '+%Y-%m-%d %H:%M:%S' -D '%s' -d $((`date '+%s'` +
> 3*24*60*60)) )
> touch -d "$plus3days" FILE
> 
> Note that date -D is a busybox extension.

coreutils' touch actually allows relative dates and times:

  touch -d "+3 days" FILE

does what you would expect. That's a potential enhancement to Busybox.

>>> Dan
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to