Re: bash OK, Cron job not?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



John Horne wrote:
> On Mon, 2007-08-20 at 12:42 -0400, Mark Haney wrote:
>> I have a strange problem I can't seem to figure out.  Maybe it's the
>> newbie in me. Below I have the following running in a cron job:
>>
>> mail -s "LDM missing files totals: LDM1 `date +%D`" ....
>>
>> Now, from bash this works perfectly, I get the date and everything.  But
>> from cron I get this:
>>
>>> /bin/sh: -c: line 0: unexpected EOF while looking for matching ``'
>>> /bin/sh: -c: line 1: syntax error: unexpected end of file
>> Can someone explain to me why?
>>
> Put a backslash (\) before the percent sign in your cron job. It needs
> escaping; this has caught me out several times :-)
> 
> So, try:
> 
>    mail -s "LDM missing files totals: LDM1 `date +\%D`"
> 
> 
> 
> John.
> 

I'm an idiot.  I /should/ have seen that a week ago.  Thanks.  Ignore
the pinhead in the corner.


-- 
Recedite, plebes! Gero rem imperialem!


Mark Haney
Sr. Systems Administrator
ERC Broadband
(828) 350-2415

Call (866) ERC-7110 for after hours support


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux