[geeks] Shell quoting question...

William Kirkland bill.kirkland at gmail.com
Mon Jul 17 11:14:30 CDT 2006


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



More information about the geeks mailing list