[geeks] geeks Digest, Vol 44, Issue 18

William Kirkland bill.kirkland at gmail.com
Mon Jul 17 15:29:58 CDT 2006


Apparently my previous post was a bit premature ... after a bit of  
testing, I found that the '%' may be escaped by a '\' as in

	55 * * * *  date "+\%F"

... just using the `date` command as an example ...


On Jul 17, 2006, at 09:14, geeks-request at sunhelp.org wrote:
>   10. Re: Shell quoting question... (William Kirkland)

> Message: 10
> Date: Mon, 17 Jul 2006 09:14:30 -0700
> From: William Kirkland <bill.kirkland at gmail.com>
> Subject: Re: [geeks] Shell quoting question...
> To: geeks at sunhelp.org
> Message-ID: <4A9E4AFC-FEB9-4D1F-B96D-C16AACAE287C at gmail.com>
> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
>
> try replacing the '%' with the octal representation '\045' (see the
> man page for ascii for additional characters) ... then cron should
> pass the actual ascii character to the shell.
>
> On Jul 17, 2006, at 08:19, geeks-request at sunhelp.org wrote:
>
>> Message: 7
>> Date: Mon, 17 Jul 2006 10:27:33 -0400
>> From: "Francois Dion" <francois.dion at gmail.com>
>> Subject: Re: [geeks] Shell quoting question...
>> To: "The Geeks List" <geeks at sunhelp.org>
>> Message-ID:
>> 	<307695d40607170727v5e2bc54du711b91e11e866b4b at mail.gmail.com>
>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>>
>> On 7/14/06, Robert Slover <robert.j.slover at verizon.net> wrote:
>>>> From: velociraptor <velociraptor at gmail.com>
>>>> I'm having some trouble with a cron job, I can't figure out how to
>>>> escape it to make it work...
>> [...]
>>>> 00 05 * * * /export/home/nmiller/script "profile%20name" > /dev/ 
>>>> null
>>>> 2>&1
>> [...]
>>> The problem isn't that '%' is special to the shell -- it is
>>> special to
>>> *cron*.  For cron, it means to terminate the job specification at
>>> that
>>> point, and pass what follows as STDIN.  Each subsequent % means
>>> newline.
>>
>> Looking at cron's source confirms that:
>> http://cvs.opensolaris.org/source/xref/on/usr/src/cmd/cron/cron.c
>>
>> starting at line 1034 up to 1044.
>>
>> Ciao,
>> Francois
>
>
> ------------------------------
>
> _______________________________________________
> geeks mailing list
> geeks at sunhelp.org
> http://www.sunhelp.org/mailman/listinfo/geeks
>
>
> End of geeks Digest, Vol 44, Issue 18
> *************************************



More information about the geeks mailing list