tobold.org

correct • elegant • free

△ comp.unix.shell △

◅ $@ and $* ??

replacing space with underscore ▻

shell expansion inside crontab

In article <50534D0D88D99532.BBCFFD4D2323C2AC.37B2865ED71AC671@lp.airnews.net>,
Otavio Exel <oexel@economatica.com.br> wrote:
>| 1 0 1 * * mv mailbox mailbox.`date '+%Y%m' --date 'last month'`

See crontab(5)...

                        Percent-signs  (%) in the command, unless
       escaped with backslash (\), will be changed  into  newline
       characters, and all data after the first % will be sent to
       the command as standard input.

Try this.

    1 0 1 * * mv mailbox mailbox.`date +\%Y\%m --date 'last month'`

Tim.
--
Tim Goodwin   | "You don't need to do drugs in order to
University of | think that the government's policies are
Leicester, UK | stupid and dangerous." -- David Bancroft

Original headers:

From: tjg@ltpcg.star.le.ac.uk (Tim J Goodwin)
Newsgroups: comp.unix.shell
Subject: Re: shell expansion inside crontab
Date: 1 Jul 1999 11:19:51 +0100
Organization: University of Leicester, UK
Message-ID: <7lffc7$51j$1@ltpcg.star.le.ac.uk>
References: <50534D0D88D99532.BBCFFD4D2323C2AC.37B2865ED71AC671@lp.airnews.net>

△ comp.unix.shell △

◅ $@ and $* ??

replacing space with underscore ▻