Article View: es.comp.os.linux.programacion
Article #7082Re: script sh
From: Erich Lerch
Date: Fri, 04 Apr 2003 10:46
Date: Fri, 04 Apr 2003 10:46
23 lines
1786 bytes
1786 bytes
* [ZoRo] <granbilbao_NOSPAM_@latinmail.com>: > hola estoy haciendo un scrip sh p�ra borrar unas cosas del disco una vez > pasado un mes. > para eso creo ciertos archivos con el numero del dia que fueron creados en > el nombre, a�adiendoles data +%j > pero para borrarlos tendr�a que poder restar al date +%j 30 osea como si > fuera date +%j -30 > perp esto no me vale. > alguein sabe si en una varialbe tengo metido ese valor (el date %j) como > puedo restarle 30? Como ya te han sugerido, quizas lo mejor es usar "find". Pero lo puedes hacer con "date" tambien (GNU date, que normalmente viene con las ditribuciones): date +%j -d "30 days ago" saludos, e. -- Erich Lerch GnuPG-Key: http://lerchs.org/gpglerch.asc
Technical Details
Message-ID:
<slrnb8qojr.j7.lerch.news@gmx.ch>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!183.red-80-38-46.pooles.rima-tde.NET!not-for-mailReferences:
<b6idgo$5o1li$1@ID-59646.news.dfncis.de>Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII X-Google-Thread: f86c8,41c263e7698a53de X-Google-Attributes: gidf86c8,public X-Google-ArrivalTime: 2003-04-04 02:49:14 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!183.red-80-38-46.pooles.rima-tde.NET!not-for-mail From: Erich Lerch <lerch.news@gmx.ch> Newsgroups: es.comp.os.linux.programacion Subject: Re: script sh Date: Fri, 4 Apr 2003 12:46:19 +0200 Organization: http://lerchs.org Lines: 23 Message-ID: <slrnb8qojr.j7.lerch.news@gmx.ch> References: <b6idgo$5o1li$1@ID-59646.news.dfncis.de> NNTP-Posting-Host: 183.red-80-38-46.pooles.rima-tde.net (80.38.46.183) Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: fu-berlin.de 1049453336 6437500 80.38.46.183 (16 [88913]) X-Orig-Path: gurb.mine.nu!news User-Agent: slrn/0.9.7.4 (Linux)